Invoice: when customer item detail = X then print image

Is it possible to generate / include a script, that when a condition is met; I have a customer detail on item level; an image is included/printed in the table. It involves an icon which I want to display when a condition is met. What would be the right approach?

Edit: I got this far with eval:doc.field=“yes”. How do I make it a default image to be shown here when the selection is “yes”?