Of course, it would be ideal to abstract your javascript into a separate behavioral layer, so you have a lean and still accessible valid markup.
Something like this:
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Untitled
Text Here
As you can see, the actually html on the page is very light. A standard unordered list with links to the images. I have included some javascript that, once it runs, hooks into the humpics element and attaches an onclick event handler to each link in the list. The function it attaches takes the href value and replaces the placeholder image. It also takes the title attribute and replaces the text in the paragraph below it. There is also a function that allows you to load many functions at load time.
Without seeing where you are implementing this I have no idea if this is even what you are looking for.
I am just bored and waiting to get my night started