Do you use iCloud Photos? Do you use iCloud backup?
If you don't use iCloud Photos, then iCloud backup ( Settings>Apple ID>iCloud Backup) turned on, then your pictures will be saved there.
What does iCloud back up? - Apple Support
Then you can wipe your phone and restore it:
Restore your iPhone, iPad, or iPod touch from a backup - Apple Support
“Restore” is what you do when you buy a new phone, so this safety, if you have it set, requires you to erase everything on your phone and replace it with the backup. When I've bought a new phone, it had all the same stuff on it.
If you use iCloud.Photos, then iCloud doesn't store them in both places. The pictures at iCloud.com will remain after a reset, and your Photos app will automatically download the pictures from iCloud.
There are some iffy cases, though. Some pictures, especially those transferred to the phone from a computer or maybe from some web sites can be shown by Photos, they aren't controlled by Photos. The original assumption was that those pictures are still on the computer they came from. So those images may not get saved by iCloud Backup
If you don't keep your own backups to an external drive, then there really isn't any place else to look.