{# 1. Check if an image currently exists on the bound instance #}
{% if profile_form.instance.profile_image %}
{# 2. Explicitly render the 'Clear' checkbox and the Change input #}
{# The ClearableFileInput widget renders itself here. It provides the "Clear" checkbox and the "Change" input field. #}
{{ profile_form.profile_image }}
{% else %}
{# If no image exists, just render the file input for upload #}
{{ profile_form.profile_image }}
{% endif %}
{# Display any validation errors #}
{% for error in profile_form.profile_image.errors %}
{{ error }}
{% endfor %}