prova così:

$count = 1;
echo "<tr valign='top'>";
while ($picture = mysql_fetch_array($pictures)) {
$id = $picture['id'];
$filename = htmlspecialchars($picture['filename']);
$extension = htmlspecialchars($picture['extension']);
$description = htmlspecialchars($picture['description']);
$miniatura = 'foto/'.$filename.'_s'.$extension;
if ($count!=6) {
echo "<td>";
print '[img]'.$miniatura.'[/img]';
echo "</td>";
$count++;
}
else {
echo "</tr>";
echo "<tr>";
echo "<td>";
print '[img]'.$miniatura.'[/img]';
echo "</td>";
$count=2;
}


}//while