I don't think I'm understanding your point fully, but you basically want assign a certain background image to a certain page, yes? If so, you could add an image class or ID (if a different one in each page) in $header or wherever you want, using CSS.
e.g., in $header:
HTML Code:
<img src="spacer.gif" class="whateverClass" alt="" />
OR
<img src="spacer.gif" id="whateverID" alt="" />
<!-- CSS in a different file, but using HTML BBCode anyway -->
img.whateverClass {
background-image:url(pathtoimage);
background-repeat:none;
}
OR
img#whateverClass {
background-image:url(pathtoimage);
background-repeat:none;
}
But again, I don't think I understood your point correctly.