On an iphone before you post a pic you need to rotate the pic 180* and save it. Then rotate back 180* and save it again and it will post right side up.
To avoid this in the future you must take pics with the volume buttons pointed towards the ground and then they will post right side up every time.
Hope this helps