You can't just send the JPG data willy-nilly in the middle of your HTML. It is not PHP that is the problem, browsers just don't work that way. In order for a browser to render an image, sound, or whatever, it has to know what it is.
Send the image using a seperate PHP script that sends the correct headers before the image data. Let's say you call it "sendImage.php". Then change your script above to something like:
<font color=blue>
<head>
<title>gallery.photos</title>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" bgcolor="#FFFFFF">
<IMG SRC="sendImage.php?imageLink=<? print urlencode($imageLink); ?>">
</body>
</font>
"sendImage.php" can then use $imageLink to send the image data like you did in your first example (after sending the jpg headers, of course).
-- Rich