Prueba a sustituir esto
$row=mysql_fetch_array($resultados);
por esto otro...
if($row=mysql_fetch_array($resultados))
{
todo el bloque html y cierras al final el if
}
Quedaría así...
Código PHP:
if($row=mysql_fetch_array($resultados))
{
echo '<td>';
echo '<p align="center"><img src="'.$row["foto1"].'"></p>';
echo '<br>';
echo '<p align="center">'.$row["titulo"].'</p>';
echo '</td>';
}
}
Este otro bloque
Código PHP:
if($contador>5)
{
echo '<tr>';
$contador=0;
}