Download image off google images

I am making a script to search for and image on google images, download the first hit and set it to the desktop picture.
I am looking for a way to download the first image in google images.

Model: Early 2008 iMac 20" 250 GB HD
AppleScript: 2.1.1
Browser: Safari 4.0.4
Operating System: Mac OS X (10.6)