You can do two things. You can do an iCloud backup which usually takes care of it, or you can import your photos to mac / PC first.
I would recommend importing to a PC / mac first in to something like iPhoto or image capture, and after the import make sure to delete all the photos from your iPhone. iPhoto usually asks you after.
We then still want to do the iCloud backup. It will back up your iMessages, apps, photos etc. But iCloud is only 5gb unless you pay more yearly - so you really want to make sure to offload photos 1st
Open settings app and choose iCloud.
Scroll to bottom and choose storage and backup.
Make sure iCloud backup is on, then choose backup now. After the backup completes without errors you are clear to upgrade to iOS 7.
If you can't offload photos from iPhone easily due to lack of computer, then in iCloud storage page, choose "change storage plan" and purchase more storage. This will let iCloud backup entire phone.
The creator of this guide has not included tools
New York, New York