Perl Image Validation