Ah, I think I see. Are you using Server Side Includes to put this header.php onto your page? If that's what you're doing, you could access the PHP script with a query string saying which image you want to be put. For instance:
On page 1, <!--#include virtual="header.php?image1" -->
Tell the script to put image1 as the image.
On page 2, <!--#include virtual="header.php?image2" -->
Tell the script to put image2 as the image.
And then in the script, you could do something like:
print '<img src="'.$_SERVER['QUERY_STRING'].'.gif">';
Is that what you wanted to do?