php で出力した画像を HTML で表示するのは以下のようにする。
test.html はもちろん php でもよい。
image.php は readfile で画像を読み込み、ブラウザに出力しているだけ。
このとき image.php は、header 関数で Content-Type を出力するより前に、何かのデータをブラウザに送ってはいけない。

test.html
<HTML>
<img src="image.php" />
</HTML>

image.php
<?php
header('Content-type: image/png');
readfile('example1.png');
?>