Sideway photos is something iPhones do. Edit it right after taking a picture and crop out a very small part of the image and it should fix it.