logic for inline image choice