When I have used in the past - I tend to call it once, because if the onload was left within BODY tag for every page then yes it would recache the image. For example, I used it for this site I developed
www.yhp.org.uk whereby the home page would use the function to call a percentage of the graphics used throughout the site. However, at the time I didnt consider the load this would add to the page, however, does the trick.
Maybe it might be best reviewing the JavaScript forum for ideas? as I'm drifting off the CSS route a little here
Gaz