Algo asi:
Código PHP:
$x=0;
while($lol=mysql_fetch_array($ll)) {
echo "<table width='400' cellpadding='0' cellspacing='0' border='0'><tr>"
if($x<4 ){
echo "<tr><td height='100'>$lol[$foto]</td>"; // Aqui devuelves las fotos
$x+=1;
}
else {
echo "</tr>";
$x=0;
}
}