### ImageMagick version

ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25

### Operating system

Linux

### Operating system, version and so on

Debian GNU/Linux 11 (bullseye)

### Description

orienation in montage gets wrong

I remove almost all exif fields. Both photos, the vertical side is the biggest one eg. 4000x2000. However, montage gets 1st vertical and 2nd one horizontal. I cant explain that behavior. 

removing exif data
`find . -name '*.jpg'  -exec exiftool  -r -all=""  *.jpg *.jpeg *.JPG {} +`

montaging...
`montage aa_01.jpg aa_02.jpg -tile 2x1 -geometry +1+1  -quality 100 screenshot1.jpg`

Watch the result! 
![Επιλογή_120](https://user-images.githubusercontent.com/41580704/222780194-3216e1d8-8be6-48c0-ace2-0f85f24d5e93.jpg)




### Steps to Reproduce

removing exif data
`find . -name '*.jpg'  -exec exiftool  -r -all=""  *.jpg *.jpeg *.JPG {} +`

montaging...
`montage aa_01.jpg aa_02.jpg -tile 2x1 -geometry +1+1  -quality 100 screenshot1.jpg`


### Images

_No response_
orienation in montage gets wrong
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : orienation in montage gets wrong
Issue date:

--- start body ---
### ImageMagick version

ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25

### Operating system

Linux

### Operating system, version and so on

Debian GNU/Linux 11 (bullseye)

### Description

orienation in montage gets wrong

I remove almost all exif fields. Both photos, the vertical side is the biggest one eg. 4000x2000. However, montage gets 1st vertical and 2nd one horizontal. I cant explain that behavior. 

removing exif data
`find . -name '*.jpg'  -exec exiftool  -r -all=""  *.jpg *.jpeg *.JPG {} +`

montaging...
`montage aa_01.jpg aa_02.jpg -tile 2x1 -geometry +1+1  -quality 100 screenshot1.jpg`

Watch the result! 
![Επιλογή_120](https://user-images.githubusercontent.com/41580704/222780194-3216e1d8-8be6-48c0-ace2-0f85f24d5e93.jpg)




### Steps to Reproduce

removing exif data
`find . -name '*.jpg'  -exec exiftool  -r -all=""  *.jpg *.jpeg *.JPG {} +`

montaging...
`montage aa_01.jpg aa_02.jpg -tile 2x1 -geometry +1+1  -quality 100 screenshot1.jpg`


### Images

_No response_
--- end body ---
