Ok, ore le immagini si vedono, ma solo una alla volta (e non 2 contemporaneamente). Il codice che utilizzo è il seguente:

<?
if (isset($_GET['id']))
{
$id = @intval($_GET['id']);
@include 'config.php';
$sql = "SELECT foto_id,foto_type,foto FROM img WHERE foto_id='$id'";
$result = @mysql_query($sql) or die(mysql_error ());
$row = @mysql_fetch_array($result);
$id_img = $row['foto_id'];
$type = $row['foto_type'];
$img = $row['foto'];
if (!$id_img)
{
echo "Id sconosciuto";
}else{
@header ("Content-type: ".$type);
echo $img;
}
}else{
echo "Impossibile soddisfare la richiesta.";
}
?>