Algo asi
Código PHP:
<table>
<?php
$r= mysql_query("select img,fecha from tabla");
$cont=1;
while ($row = mysql_fetch_array($r)){
if (($cont % 5)==0 or ($cont==1))
echo '<tr>';
echo '<td> <img src='$row['img']' /> $row['fecha'] </td>';
if (($cont % 5)==0 )
echo '</tr>';
$cont++;
}
?>
</table>