Promise to detect the image dimensions from a file