For those who are looking for an answer – after trial and error i found the “if” statement i was looking for. Full code as follows:
$variablename = get_field('dcfg_global_item_select');
if ( !empty( $variablename ) ) {?>
<div class="container">
<?php foreach($variablename as $variablename2):?>
<a href="<?php echo get_page_link($variablename2 ->ID);?>">
<center>
<img src="<?php echo get_the_post_thumbnail_url($variablename2->ID, 'medium');?>">
</center>
</a>
<?php endforeach;
}?>
<?php $variablename = get_field('dchdl_global_item_select');
if ( !empty( $variablename ) ) {?>
<div class="container">
<?php foreach($variablename as $variablename2):?>
<a href="<?php echo get_page_link($variablename2 ->ID);?>">
<center>
<img src="<?php echo get_the_post_thumbnail_url($variablename2->ID, 'medium');?>">
</center>
</a>
<?php endforeach;
}?>
<?php $variablename = get_field('dcstd_global_item_select');
if ( !empty( $variablename ) ) {?>
<div class="container">
<?php foreach($variablename as $variablename2):?>
<a href="<?php echo get_page_link($variablename2 ->ID);?>">
<center>
<img src="<?php echo get_the_post_thumbnail_url($variablename2->ID, 'medium');?>">
</center>
</a>
<?php endforeach;
}?>
<?php $variablename = get_field('dcthdl_global_item_select');
if ( !empty( $variablename ) ) {?>
<div class="container">
<?php foreach($variablename as $variablename2):?>
<a href="<?php echo get_page_link($variablename2 ->ID);?>">
<center>
<img src="<?php echo get_the_post_thumbnail_url($variablename2->ID, 'medium');?>">
</center>
</a>
<?php endforeach;
}?>
<?php $variablename = get_field('drcfg_global_item_select');
if ( !empty( $variablename ) ) {?>
<div class="container">
<?php foreach($variablename as $variablename2):?>
<a href="<?php echo get_page_link($variablename2 ->ID);?>">
<center>
<img src="<?php echo get_the_post_thumbnail_url($variablename2->ID, 'medium');?>">
</center>
</a>
<?php endforeach;
}?>
<?php $variablename = get_field('drchdl_global_item_select');
if ( !empty( $variablename ) ) {?>
<div class="container">
<?php foreach($variablename as $variablename2):?>
<a href="<?php echo get_page_link($variablename2 ->ID);?>">
<center>
<img src="<?php echo get_the_post_thumbnail_url($variablename2->ID, 'medium');?>">
</center>
</a>
<?php endforeach;
}?>
<?php $variablename = get_field('drcstd_global_item_select');
if ( !empty( $variablename ) ) {?>
<div class="container">
<?php foreach($variablename as $variablename2):?>
<a href="<?php echo get_page_link($variablename2 ->ID);?>">
<center>
<img src="<?php echo get_the_post_thumbnail_url($variablename2->ID, 'medium');?>">
</center>
</a>
<?php endforeach;
}?>
</div>
<?php }?>
<?php add_shortcode('show_global_pics_in_personal', 'show_global_pics_in_personal_library');