How to hide unused thumbnails in HTML template

If you are using image url placeholders and want to only show image tags where there are corresponding image values you can put conditional formatting in the HTML using javascript. For example:

 <script language="javascript" type="text/javascript">
if ("#?SupplementalImageURL01?#" == "")
            document.getElementById('img02').style.display = 'none';
if ("#?SupplementalImageURL02?#" == "")
            document.getElementById('img03').style.display = 'none';

How did we do?