Determines the dimensions of an image.