Added image file checking