Fixed bug where image markup would not always work