determine image type by *getimagesize*