fix for issues: landscape to portrait: wrong image selected in thumbnail #2 and portrait to landscape: image is not centered #1