I have replaced the code with teh suggested code and am now getting a code error in Dreamweaver CS5.5 . here is the whol line including the revised alt code.:
<a href="<?php echo($fullsizeImgSrc); ?>" rel="lightbox-pg<?php echo($random ); ?>" name=""><img src="<?php echo($imagePath); ?>" alt="'.str_replace('"', '\"', $row_images['title']).'" title="<?php echo($i . '####'); ?>" width="<?php echo($thumbnailInfo['width']); ?>" height="<?php echo($thumbnailInfo['height']); ?>" /></a>
I can't see any problems, but dreamweaver reports code error with teh changes.