Send headers that tell the browser to cache it, and only send them with stuff you want cached? I'm not sure if it will work, but worth a try...
code:
// date in the past
header("Last-Modified: Tue, 01 Jul 2003 00:00:00 GMT");
// date in the future
header("Expires: ".gmdate("D, d M Y H:i:s", time() + 86400)." GMT");
As long as the URL stays the same (like index.php?img=head) I think it will work...