Now checks for valid image file.