As photos no longer back up to your Samsung Account i.e Samsung Cloud anymore Samsung then introduced the new option of using Onedrive to do this.
I'm wondering if this happened on your phone and your pictures auto backed up ?
If you take it to a Samsung Experience Store / Samsung Service Centre they will typically factory reset it meaning you'll lose all your data including any locally stored photos.
Unfortunately there's no easy answer due to the removal of a Sd card option which is where people would normally back up to.
Personally I use a vault called Dropbox to back up my photos to which is something you could now consider so this does not happen again.
Other options such as Google Photos etc are also available.
If you do go somewhere to see if they can access the phone with their own software then make it clear to them not to factory reset.
I understand photos are cherished memories so I wish you all the best with this situation.
Current Phone > Samsung Z Fold³ 5G. > Software : Android 12 ~ Samsung One Ui 4.