fixed issue with extra-wide images not filling gallery

Previously wouldn't scale the image to fill gallery in all cases.