在文件夹php中获取元素图像

while($row = mysql_fetch_array($rs))
{
    $first = true;
    $fldr = $row["fldr"];
    $ttle = $row["title"];
    $directory = "admin/uploads/$fldr/";
    $images = glob($directory . "*.JPG");
    $im="";
    $html="<div class='col-md-3 gallry'><ul class='gallery clearfix'>";
    foreach($images as $image)
    {
        if ( $first ){
            $first = false;
            $html .= "<li><a href='admin/uploads/$fldr/$image' rel='prettyPhoto[gallery1]' title=''><img src='admin/uploads/$fldr/$image' class='img-responsive' alt='' /></a></li>";
        }
        else
        {
            $html .= "<li><a href='admin/uploads/$fldr/$image' rel='prettyPhoto[gallery1]' title='' style='display:none;'></a></li>";
        }

        $im =  $image;
    }
    $html .= "</ul><h6>$im</h6></div>";
}

The images didn't load. I need to access the images directory and load it to li tags. If anyone know how to do this help me..