update fitImagesInViewport

Fixed incorrect scaling of the element width