markdown support and new hasImage function