I just did this recently. The "Nexus Root Toolkit" is pretty useful; it's a Windows application which does all of the driver and backup operations, as well as a "root my device" button.
Word of (minor) warning. The Gallery app's for each Album shows the images in the descending date/time order, with newer images at the front. If you back up your pictures by manually copying them in Windows Explorer (MTP mount, drag-drop) and then bring them back after rooting, all of the images will get a NEW time stamp of the time that they got copied to the camera. Your images will no longer be in the order you took them.
The Nexus Root Toolkit offered to back up the images for me, but never seemed to be able to do it. Perhaps it would have been successful - I don't know. Or: PTP might have kept the dates, while MTP didn't.