<div class="asset-selector-container">  
    <div class="field-label inline" th:text="#{${field.friendlyName}}" th:classappend="${field.required ? 'required' : ''}" />
    <span class="error" th:errors="*{fields['__${field.name}__'].value}" />
    <a class="show-asset-freeform-url" href="#">([[#{Freeform_URL}]])</a>
    <br/>
    
    <input type="hidden" class="mediaUrl twelve" th:field="*{fields['__${field.name}__'].value}" th:classappend="${field.required ? 'required' : ''}" />
    
    <img class="thumbnail" 
        th:if="*{fields['__${field.name}__'].value != null}"
        th:src="@{*{fields['__${field.name}__'].value + '?largeAdminThumbnail'}}"
        th:attr="data-fullurl=@{*{fields['__${field.name}__'].value}}" />
        
    <img class="thumbnail" 
        th:unless="*{fields['__${field.name}__'].value != null}" />
    
    <button class="show-asset-selector tiny radius secondary button hover-cursor"
        type="button" th:inline="text"
        th:attr="data-select-url=@{${'/'+sectionKey+ '/' + entityForm.id + '/chooseAsset'}}">
        <i class="icon-camera"></i>&nbsp;[[#{Select_Upload_Image}]]
    </button>
    
</div>



<div class="asset-selector-container">  
    <div class="field-label inline" th:text="#{${field.friendlyName}}" th:classappend="${field.required ? 'required' : ''}" />
    <span class="error" th:errors="*{fields['__${field.name}__'].value}" />
    <a class="show-asset-freeform-url" href="#">([[#{Freeform_URL}]])</a>
    <br/>
    
    <input type="hidden" class="mediaUrl twelve" th:field="*{fields['__${field.name}__'].value}" th:classappend="${field.required ? 'required' : ''}" />
    
    <img class="thumbnail" 
        th:if="*{fields['__${field.name}__'].value != null and fields['__${field.name}__'].value != ''}"
        th:src="@{*{fields['__${field.name}__'].value + '?largeAdminThumbnail'}}"
        th:attr="data-fullurl=@{*{fields['__${field.name}__'].value}}" />
        
    <img class="thumbnail" 
        th:unless="*{fields['__${field.name}__'].value != null and fields['__${field.name}__'].value != ''}" />
    
    <button class="show-asset-selector tiny radius secondary button hover-cursor"
        type="button" th:inline="text"
        th:attr="data-select-url=@{${'/'+sectionKey+ '/' + entityForm.id + '/chooseAsset'}}">
        <i class="icon-camera"></i>&nbsp;[[#{Select_Upload_Image}]]
    </button>
    
</div>



Add safety check against empty strings
Add safety check against empty strings
