Well, I would change
// prepare the query string
$query = "SELECT id, name, email, ip, message, DATE_FORMAT(entry_date, '%d.%m.%Y') ".
"FROM xcomments WHERE image_id=".$_GET['view']." ".
"ORDER BY id DESC ".
"LIMIT $offset, $rowsPerPage";
echo $query;
// execute the query
$result = mysql_query($query) or die('Error, query failed');
to something like
// prepare the query string
$query = "SELECT id, name, email, ip, message, DATE_FORMAT(entry_date, '%d.%m.%Y') ".
"FROM xcomments WHERE image_id= '$image_id' ".
"ORDER BY id DESC ".
"LIMIT $offset, $rowsPerPage";
echo $query;
// execute the query
$result = mysql_query($query) or die('Error, query failed [$query]');
so I added in the quotes around the id variable. I also used the variable you were getting at the top of the script rather than pulling it out of the $_GET array again. Lastly, I added the $query to your die statement.