calculate amount of images to load