Running out of ideas - how to delete all photos on my iPhone appearing to be a leftover from the icloud migration in Photos?

I currently have an iPhone 8 with 256 GB storage which I migrated my previous iPhone SE 1st edition with 64 GB storage to when I got it from an iTunes backup and reused the SE for other purposes. I also have a lot of photos which I originally kept in Photos on my Mac and used Photostream to automatically copy new photos to my iPhone. At one point I transferred my photo library (50000 photos and videos) to iCloud and did as prompted and it has worked well for me.

Now I broke the glass on the iPhone 8 so I need to send it in for repairs (corona prohibits walk-in repairs) which may take several days, so I would like to do the "backup to itunes - restore backup on reset device keeping passwords and everyting" exercise again but this time back to the iPhone SE

Unfortunately iTunes refuses to restore the backup as the device is too small. Investigations show that photographs take a lot of space (see image) even after turning iCloud off on the iPhone 8 and then trying to synchronize from my Mac again with just a single album containing a single image. Didn't get rid of them.

I cannot delete the Photos app so this cannot get rid of the data. I can attach a bluetooth keyboard but the Apple-A command doesn't select all the images for deletion. I can run xcode on my Mac against the 8 if necessary.

Is there a way to remove the Photos other than one at a time?

enter image description here


It turned out when connecting with cable and starting Image Transfer that the Camera Roll on the iPhone contained 38.000 photos (which I suppose somehow happened during my Photos-on-Mac -> iCloud migration last year).

The Image Transfer program could delete them all but it took a few hours, and the backup size shrunk as expected to be small enough.

The "Hey you have a new iPhone next to this one"-transfer from the old iPhone to the new could then complete as expected.