resize photos to fit in the viewport