Thanks for your help! I followed your suggestion and got rid of a lot of dead code. The result is disappointingly nearly the same (I think)!
The code is now:
<?php head(array('title' => item('Dublin Core', 'Title'), 'bodyid'=>'items','bodyclass' => 'show item')); ?>
<div id="primary">
<h1><?php echo item('Dublin Core', 'Title'); ?></h1>
<!-- The following returns all of the files associated with an item. -->
<div id="itemfiles" class="element">
<h3>Files</h3>
<div class="element-text">
<?php
if (item_has_thumbnail())
{
echo '<p><em>Click the image for Full Size</em></p>';
echo display_files_for_item(array('linkAttributes'=>array('rel'=>'lightbox[gallery]'))); }
else
{
echo display_files_for_item();
}
?>
</div>
</div>
<!-- end item-metadata -->
<!-- The following function prints all the the metadata associated with an item: Dublin Core, extra element sets, etc. See http://omeka.org/codex or the examples on items/browse for information on how to print only select metadata fields. -->
<?php echo custom_show_item_metadata(); ?>
<!-- If the item belongs to a collection, the following creates a link to that collection. -->
<?php if (item_belongs_to_collection()): ?>
<div id="collection" class="element">
<h3>Collection</h3>
<div class="element-text"><p><?php echo link_to_collection_for_item(); ?></p></div>
</div>
<?php endif; ?>
<?php echo plugin_append_to_items_show(); ?>
<ul class="item-pagination navigation">
<li id="previous-item" class="previous">
<?php echo link_to_previous_item('← Previous Item'); ?>
</li>
<li id="next-item" class="next">
<?php echo link_to_next_item('Next Item →'); ?>
</li>
</ul>
</div><!-- end primary -->
<?php foot(); ?>
I tried changing display_files_for_item(array('linkAttributes'=>array('rel'=>'lightbox[gallery]')));
To
display_file($firstFile,array('linkAttributes'=>array('rel'=>'lightbox[gallery]')));
but that didn't give the desired result.
I am at a loss: I have quite a few objects that could have quite a few images attached to them and I do not want them all to show up at the same time!! I am going through the code step by step to see what could be changed to make only one image appear, but I am running out of options.