I'm using some PHP to display some HTML and attached images if present or hide the html if no images are attached to the node. How ever, my code ignores the list checkbox (screen shot) option. I'd like the ability to display images if present, but do not display in the list if the option is unchecked.

Can anyone tell me how to do this in the below PHP segment?

<?php if ( !empty($field_image_rendered) ) :?>
<h3>Gallery</h3>
<div id="gallery_thumb">
<?php print $field_image_rendered; ?>
</div>
<?php endif; ?>