Refactor image markup