[Smart Custom Fields] How to hide unfilled items

Code

<?php
$sub_img = SCF::get( 'Subimage' );
$sub_img = wp_get_attachment_image_src( $sub_img, 'large' );
$sub_img_url = esc_url( $sub_img[ 0 ] );
?>
<?php if (!empty($sub_img)){ ?>
<div>
<h3 class="subt3">Subimage</h3>
<img src="<?php echo $imgUrl ?>">
</div>
<?php } ?>

Related article