If youre images are rotated on your website unexpectedly, it could be due to hidden EXIF data stored on the image when taking the photo
Visit a 3rd party website such as http://www.verexif.com/en/
There will be an option to remove exif data and download a cleaned image.
Once done your image may need rotating again, but once done should display ok across different devices.