

If you’re looking for a more sure fire way, don’t use the app/your phone. Go to Google takeout and download all your contents from Photos onto your computer - if you have access to one. They come in zip files, which you can then unpack and store everything on your nextcloud server.
Edit: important info in the replies below.
Those googly-eyed SOBs! You’re right. I’m planning to migrate my photos to Ente whose upload tool fixes this, I think. But Nextcloud probably will not.