Read dimensions from a JPEG, GIF or PNG file and return an array with
width and height, or if the file isn't a valid image, 0. The argument
file should be either a path to a file or a file object. The offset
pointer will be assumed to be at the start of the file and will be
modified by the function.