whoops. Change $i back to 0, and modify your while statement as follows:
while ($row = mysql_fetch_array($result)) {
if ($i%$cols == 0) echo "</tr><tr>\n";
echo "<td>\n";
echo "<a href=\"abstract.php?id=" .
$row['id'] . "\"><img src=\"../abstract/images/" .
$row['category'] . $row['id'] .
$row['small'] . ".jpg\"></a>\n";
echo "</td>\n";
$i++;
}
If you want to see why, set your border=1 in the table, and you'll see an extra cell at the end of your table. Yuck. the fix above will take care of that. I also added the </a> to the end of your URL, as you may have already noticed was missing.
Incidentally, you can edit your posts, and delete them as well. That way you don't have redundant posts, and you don't have to to say "ignore my last post." 🙂