Condition on image tag generation code