This is exactly why you can't get a decent photo uploader on iOS to upload in the background. The existing ones either stop after a few because iOS puts it to sleep (or whatever the term is) or they have to use location services to stay awake longer, but that's a gross hack.
I get why Apple does this. I just wish they would let me choose to have an app run as a service. Being able to sync all my photos to NextCloud while running in the background (and not divulging my location) would be great.