error php Undefined offset

dani
19 de Marzo del 2008
Hola, tengo el siguiente problema:

Me da este error

Undefined offset: 1 in c:archivos de programaeasyphp1-8wwwpluginscontentslimbox.php on line 109

el codigo es este:

$withthis = '';
$withthis .= '<div id="slimbox'. ($i + 1) . '">';
$countimagesets = 0;
$imagesets = explode(";",$working);
$countimagesets = count( $imagesets );

for ( $j=0; $j < $countimagesets; $j++ ) {
$thumbnail = '';
$imagefile = '';
$countpartsofimageset = 0;
$singleimage = explode(",",$imagesets[$j]);
$countpartsofimageset = count( $singleimage );
$imagefile = trim($singleimage[0]);
$thumbnail = trim($singleimage[1]); (LINEA 109)
$caption = "";
if ($countpartsofimageset == 3) {
$caption = trim($singleimage[2]);
}
if ($singleorGallery == "single") {
if ($firsttime == true) {
$withthis .= '<a href="#" onclick="return openGallery' . ($i + 1) . '()">' . '<img src="'. $thumbnail . '" border="0" /></a>';
} else {
$js .= ", ";
}
$js .= "['" . JURI::base() . $imagefile . "', '" . $caption . "']";
} else {
$withthis .= '<a href="' . JURI::base() . $imagefile . '" class="slimbox" rel="lightbox[slimbox'. $i . ']" title="' . $caption . '">';
$withthis .= '<img src="'. $thumbnail . '" border="0" /></a>';
}
$firsttime = false;
}

if ($singleorGallery == "single") {
$js .= "], 0);
}";
$document->addScriptDeclaration( $js );
}
$withthis .= '</div>';
$row->text = str_replace( $replacethis, $withthis, $row->text );
}
return true;
}
}