I'm not sure if the soft does actually fix the above issue but, the main reason this happens is that people don't allow the camera to change its orientation before taking a picture.
It's something I've had to explain to my members time and time again. Let's say you're in portrait mode and then quickly turn the phone to landscape and take a picture. If you look at the screen you'll notice the words/details on the screen are not at the right orientation. I still get caught out by this on my iPhone 8 and iPhone XS Max at times.
So, if I have taken the picture and I've noticed it's sideways when uploading, I simply go to Photo's, edit the picture and rotate it once, save it and then rotate it again until it's in the correct orientation and then save it. Now when I go to upload it, the photo is facing the correct way. This issue has been around a very long time. It's even worse when the phone is actually upside down (buttons on the bottom of the phone) as you don't realise you've turned it this way and go to take a picture.
I hope this helps others who face this issue as it's not IPS's software that is at fault. ☺️