It may be dependent on the particular device used to capture the photos, and the orientation info that gets stored along with (some) photos. I have a possible solution, but it means some low-level server changes. I'll do that as soon as I have enough time to investigate/fix, probably this weekend.