```
<?php        
    /* settings */  
    $image_dir = 'gallery/';  
    $per_column = 3;  
    $count=0;
      if ($handle = opendir($image_dir)) {  
        while (false !== ($file = readdir($handle)))  
        {  
            if ($file != '.' && $file != '..')  
            {  
                if(strstr($file,'-thumb'))  
                {  
                    $files[] = $file;  
                }  
            }  
        }  
        closedir($handle);  
    }  
    if(count($files))  
    {  
        foreach($files as $file)  
        {   
            $count++;  
            echo '<a class="thumbnail" rel="one-big-group" href="',$image_dir,str_replace('-thumb','',$file),'"><img src="',$image_dir,$file,'" width="100" height="100" /></a>';  
            if($count % $per_column == 0) { echo '<div class="clear"></div>'; }  
        }  
    }  
    else  
    {  
        echo '<p>There are no images in this gallery.</p>';  
    }  

?>  

```

How can I add captions to each of the images?
Thank you very much for the answer!