getimagesize will work on remote files - fopen will not (short of using sockets/ftp access)
just use @getimagesize('http://......') and test that $return[2] is not equal to zero (zero means it is not an image).
note: it would not work on gifs or on images protected by a direct linking protection script.

