This is because you have a camera that automatically detects portrait orientation. This facility seems nice, but is a PITA because all it does is set a flag in the image and not all software recognises that flag.
The fix is easy. For the longer term, turn off this feature in the camera. Short term, just select all the portrait images amd rotate right [CTRL/right-arrow], then left [CTRL/left-arrow].