You can use a program to flip the photo.
I connect my phone to my PC, open the file explorer, click on the photo I want to flip. The photo opens in Windows Picture and Fax Viewer. There are icons at the bottom of the screen to flip the photo 90 degrees.
There may be a photo editing program for Android that allows you to do this.
Too bad someone didn't think to make the camera flip the orientation when the phone was turned sideways. 8-0