There's a way to do this without javascript, even...
You only need one element: a <a> tag.
Using CSS, set it to display:block and give it the height and width of your image. Then set the background image of the link to the original image. This should get you to your original "image in a link" scenario. Then, you can make an a:hover style that specifies a new background image. Presto change-o.