If you already tried (to no avail) all the steps provided in the support article that led you here, AND if it happens with all pictures and/or all apps, AND if you already performed a "forced" restart of your iPhone as per these instructions:--> Force restart iPhone – Apple Support , it might be a hardware glitch.
I suggest that you make an appointment (*) and have your device inspected at an Apple Store or AASP (Apple Authorized Service Provider) among this list:--> Apple – Location Selector. After checking it out, they'll give you all the available options.
Regards
Giulio
(*) You can do it: