If you use microsoft one drive or Google photos you can save your photos there and add the accounts to your S23 they will still show in the gallery on your phone but won't take up any space on your phone. I use onedrive and all my photos are in my gallery. I hope this helps
I think you can configure one drive to download certain files and any you click on to open will download. It's not something I have done myself so would probably mean some experimenting to find what works for you