As the images are preloading the script makes a note of the image with the largest width and the image with the largest height, these dimensions are then used to set the size of the display area.