getimagesize for local and remote images

Change the getimagesize for images to support both local and remote
images.