Add detection of image dimensions.