ich hab das problem doch gefunden :9
<?php
$out2 = mysql_query("SELECT * FROM ".$table_prefix."pictures WHERE gallery_id='".$row1["gallery_id"]."' AND id < '".$row1["id"]."' ORDER BY id DESC");
$row2 = mysql_fetch_array($out2);
$out3 = mysql_query("SELECT * FROM ".$table_prefix."pictures WHERE gallery_id='".$row1["gallery_id"]."' AND id > '".$row1["id"]."' ORDER BY id ASC");
$row3 = mysql_fetch_array($out3);
?>