Achtung: "quick'n dirty" und ungetestet ;)
$i=0;
$dir = '../../images/pics/'.$jahr.'/'.$category.'/';
$verz = opendir ($dir);
$fileFound = true;
echo "<table>";
while($fileFound) {
echo "<tr>";
for($i = 0; i <= 3; i++)
{
echo "<td>";
if($file = readdir($verz))
{
if ($file != "." && $file != "..")
echo "<img src="" . $file . "">";
else
$fileFound = false;
}
echo "</td>";
}
echo "</tr>";
}
echo "</table>";