Fixed detection of file dimensions for a resource by using imagesx() and imagesy() versus getimagesize(), which is for passing strings