Apple devices are looking for data in the image file to tell them how to display the image.  When that data is missing the device falls back on its default.

The missing information is called EXIF data.  Some image editing programs support this, some do not.  

Note: A 3rd party program that supports EXIF data such as Photoshop will be needed to save the image in proper alignment. On some devices you may be able to go to the camera roll on the device and edit the image to correct the orientation. Then you can reupload it.