Check that the reference file is indeed an image, write less warnings.