How do you remove a Jailbreak with losing data?

I have an iPhone 4 and I have had my phone jail broken for about a year. I've taken a lot of pictures and added a lot of contacts in that year. I know restoring your phone takes away the jail break, but will I lose the last year of my saved data?
Pictures are stored in backups. Contacts can be stored in the backup or synced into iCloud. You can regain both of these by restoring a backup after removing the jailbreak.
Hello i am new here,i would like to ask you how to I remove the jailbreak from my iphone3gs when i can't turn it on?
Hello i am new here,i would like to ask you how to I remove the jailbreak from my iphone3gs when i can't turn it on?

Enter DFU Mode and hit restore in iTunes..
Hello i am new here,i would like to ask you how to I remove the jailbreak from my iphone3gs when i can't turn it on?

Plug the device into the PC and open iTunes. Press and hold the sleep/awake button and the home button for 10 seconds, then release the sleep/awake button but continue to hold the home button for 15 seconds. You will get a message in iTunes that the device is in recovery mode and needs to be restored.

Original thread: https://forums.imore.com/threads/how-do-you-remove-a-jailbreak-with-losing-data.256177/