See this support link-->If iTunes doesn't recognize your iPhone, iPad, or iPod - Apple Support
If you have not backed them up your photos are lost. There are several ways to back up photos; have you used any of these?
- iCloud Photo sync - the very best way: Photos are backed up to iCloud as soon as they are taken. Enabled by going to Settings/<your name>/iCloud - turn on Photos
- Photo Stream - Also back up photos as soon as they are taken, but they must be saved manually as they are only kept on your computer for a month
- Download photos to your computer using iTunes
- Enable automatic backup (same setting location as above) and your entire phone will be backed up every night if you leave it plugged in and connected to power.
- 3rd party photo sync services - Google Photos, Upthere.com, dropbox.com, box.com. All of these back up photos as soon as they are taken.
Here's more information on Apple options-->Keep your photos safely stored and up to date on all of your devices - Apple Support