correct logic for inlined image