Occasionally, when I look at a stored photo, there is no way to exit the screen. I have been turning my phone off to reset, but assume there is a more logical approach.
If photos are configured to be saved to a microSD card I would suggest backing up the data and formatting the card on a PC on either exFAT (preferred) or FAT32 format.