Add detection of image dimensions for images
Merge pull request #613 from sfan5/image_size_fix

Add detection of image dimensions for images