if the script.php you're showing here is complete, then it's because you're not setting the content type- to display an image you have to set the content type to the image type you are including. also, even if you are setting the content type using the echo command will create an error- the text you're writing isn't an image, after all ;-).
anyway, here is a complete, copied and pasted, entirely working script:
test.html
<html>
<head>
</head>
<body>
<img src="script.php">
</body>
</html>
script.php
<?php
header("Content-type: image/gif");
include("image.gif");
?>
and that should be in. you can pass querystring params to the page, perhaps to save to a database, but you cannot echo them.
hope this helps.