I upgraded to the Samsung One Ui / Pie a couple of weeks ago and I've had no issues with my photos.
Everyone I've taken have stayed in my Gallery and they also auto upload to my Dropbox Account too.
Are you using any similar vault too such as Google Photos or another.
Are you perhaps storing your photos on your Sd Card if your using one and your phone is either not reading it properly or the Sd card is corrupting in someway ?
Maybe remove the Sd card and take photos and store them just on the phone to test things .
If your using an online vault then change your preferences not to use it and again see how you go.
Daily Driver > Samsung Galaxy s²² Ultra 256Gb in Phantom Black.
The advice I offer is my own and does not represent Samsung’s position.
I'm here to help. " This is the way. "