Why not go for immich, and try adding the E2E on top? Immich will encrypt the pictures before sending them on the server, and decrypt them when trying to access them, local thumbnails, etc. That could work?
In other words, I think the E2EE is the bigger lift, and the photo stuff is the easier piece to re-implement.