Photo resizing - Bringing life back to an old script

I found and used this script some years ago. I’d like it now to only work for the image selected not every link in the document. I’m a noobie to scripting so I need some help. I know enough to change the applications names to work with CS3 but not to make the changes to only work with the selected image.
Here is the post to the script found in these forums: