'; //start column
for($j=0; $j<$imagesAcross; $j++){
if ($i<(count($mypics))){
$thumbLoc = $thumbs.'/'.$mypics[$i];
$imgLoc = $images.'/'.$mypics[$i];
if ((file_exists($thumbLoc))){ //only create link if thumb is present
//image only shows if both thumb and image are present
echo ' ';
}
if($j == ($imagesAcross-1) ){
echo ' | '; //close row
}
else{
echo ''; //close column
$i++;
}
}
}
}
//create closing
echo ' |