On your phone, when you enlarge a thumbnail (but before going full screen) there is an edit button on the upper right that allows you to rotate the image.
As to why it happens, I think that in order to get it to load correctly, the phone needs to be in landscape position (on it's side) preferably with camera eye to the picture taker's left and e shutter button to the right.