<?
$thumbsizes = array();
$thumbwidthsum = 2;
$thumbheight = 67;
foreach ($allfiles as $filename) {
  $directory = dirname($filename);
  $basename = basename($filename);
  $thumbfile = $directory .
    DIRECTORY_SEPARATOR . $basename;
  if ($thumbsize = getimagesize($thumbfile)) {
    $thumbsizes[$thumbfile] = $thumbsize;
    $thumbwidthsum = $thumbwidthsum + $thumbsize[0] + 3;
  }
}
?>