I have years worth of photos backed up from my phone (android) on Nextcloud, it's working pretty well... but it matters how you set up the auto upload and a few other things, and I'mnot claiming it's without issues.
For example, I set it to move files into Nextcloud's folder after uploading, so they appear as locally synced, and can be deleted to free up space if needed (maybe even automatically, not sure). Also, I set it to also upload existing files, because since they get moved, anything that's still there clearly needs to be uploaded.
There are a few issues viewing media from the app, sometimes, but I use the Memories app :)
I've been meaning to try immich, looks pretty good, but I use Nextcloud for much more than just photos, so I'd have to keep both and have them sync somehow, and I'm not sure how to do that.