Te comparto un mini script que realiza lo que tienes.
Yo lo utilizaba para mostrar todos los emoticons de un cierto directorio.
Código PHP:
<?
//definimos el path de acceso
$path="/home/xDxDxD/www/caca/img/gif/emoticons/";
//instanciamos el objeto
$dir=dir($path);
//Mostramos las informaciones
echo "<html>
<head>
<title>Lista de Emoticons</title>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<link rel='stylesheet' href='dominioxD.net/caca/script/css/estilo.css' type='text/css'>
</head>
<body bgcolor='#FFFFFF' text='#000000'>
<table width='200' border='0' cellspacing='5' cellpadding='5' bgcolor='#ECF6FE'>
<tr>
<td valign='top'>Emoticons<br>
<font size='1'>La siguiente lista son los emoticons disponible para usar
en el <b><font color='#009933'>Blog</font></b> y <b><font color='#009933'>Ultimos
Match</font></b> ademas tambien se puede usar en los comentarios<br>
<br>
<font color='#FF0000'><b>Forma de usar<br>
</b><font color='#000000'>hay que solo poner el nombre del emoticons, ejemplo
amor.gif</font></font></font></td>
</tr>
<tr>
<td valign='top'>
<table width='100%' border='0' cellspacing='0' cellpadding='3'>
<tr>
<td bgcolor='#C6E2F7' width='30%'><font size='1'>Imagen</font></td>
<td bgcolor='#C6E2F7' width='70%'><font size='1'>Nombre</font></td>
</tr>";
while ($elemento = $dir->read())
{
if ( ($elemento != '.') and ($elemento != '..'))
{
echo"<tr>
<td width='30%'>
<div align='center'><img src='dominioxD.net/caca/img/gif/emoticons/";
echo $elemento."";
echo"'></div>
</td>
<td width='70%'>
<div align='center'><font size='1'>";
echo $elemento."";
}
}
//Cerramos el directorio
$dir->close();
echo"</font></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>";
?>
Saludos