Hi @Thomas558
You have to add a control flow. I assume you are using a custom code. You can add an if else statement depending on what metafield type you are using, You can use the code below as reference.
{% if metafield.image != blank $}
Your metafield here
{% endif $}