The same software that FB uses for face detection, and making those hot-spots you can label with a user name, also does a quick scan to try and find the top, IIRC
There's a 'rotate' tool, or even a button, on most viewers. I'm on a Mac, so I can show you where it is in Preview.
Not sure what you've got. Poke around in the menu, then save after rotation,