Here's how you do it:
The first step is to organize the problem. The problem is that apparently we want mixed content on one page. These two types of content require two different headers. The solution is to separate the content. We have one page for the html content and one page for the image (binary) content.
The first page will deal with sending the image content to the browser.
image.php:
<?php
// since it sounds like you already know how to do this, I will assume $image is
// valid image stuff and you know how to send it to the browser
// send heades
header("Content-type: image/jpeg");
//output image
echo $image;
// or
imagejpeg($image);
//whatever..
?>
the next file is our HTML file
// index.php
<html>
<head>
<title>Test Image and HTML page</title>
</head>
<body>
<p>This is our test:<br>
<img src="image.php">
</body>
</html>
You can do anything you want if you properly separate and organize the problem.
You can use this technique to see if people read your email too...