Determine the size of images in several common formats in Perl