Let me make sure I understand this problem. The image is not being generated by PHP, but the page that points to the image is, right?
Example:
<html>
<? /* Do some stuff */ ?>
<img src="image.gif">
</html>
Or is the image itself being served by PHP
Example (Page with HTML):
<html>
<? /* Do some stuff */ ?>
<img src="image.php">
</html>
Image page (image.php):
<?
header("Content-type: image/gif");
$f = fopen("image.gif");
fpassthrough($f);
fclose($f);
?>
A separate HTTP request is made for both the image and the HTML page, and my guess is that the image is static on the server. Any "expires" headers that you pass from the PHP will only have to do with the PHP, and not the image.
A solution would be to add a parameter to the image name that will be ignored by the server, but will prevent the browser from caching the request:
Example:
<html>
<? /* Do stuff here */ ?>
<img src="image.gif?cacheBust=<?echo time()?>">
</html>
<b>Tom Brown</b>
Where gamers play
www.netnexus.com