You could save time by just downloading the first 1KB of the image. (IIRC, the location of the image size varies in JPGs, but it's very near the beginning 99.999% of the time.) This can be done using the
HTTP Range header field. A sample value would be
bytes=0-1023.