<table cellspacing="30" id="tabelaimagens">
   <tr>
    <?php 
		$LoopH = 3;
		$res = mysql_query("SELECT * FROM imagens");
		$registro = mysql_num_rows($res);
		$i = 1;
		while($list = mysql_fetch_array($res)){
			if($i < $LoopH){
				echo'
					<td align="center" valign="top" bgcolor="#FFFFFF">
					<img src="'.$list['caminho_foto'].$list['foto'].'" width="259" height="168" alt=""/><br />
					
					</td>
					';
					}elseif($i = $LoopH){
						echo'
					<td align="center" valign="top" bgcolor="#FFFFFF">
					<img src="' .$list['caminho_foto'].$list['foto'].'" width="259" height="168" alt=""/><br />
					
					</td>
					</tr>
					<tr>
					';	
					$i = 0;					
					}
				 $i ++;
				}
	?>
     
    </tr><br />
   
        
    </table>

Sendo que no seu banco vc terá uma tabela com os seguintes registros:

id,foto,caminho_foto onde:
id é a ID DA FOTO
foto é o nome da foto com a extensão exemplo: img1.jpg
caminho_foto é a pasta onde está armazenada a foto com uma barra(/) no final exemplo: imagens/.

Este script ajuda muito para exibição de produtos em loja virtual.
Abçs.