switched from resize to constrain for main images and improved image viewer layout.