md_build_img_alt: Fix crash when dealing with some mark types. For some mark types, it is possible that subsequent mark has lower 'beg' then 'end' of the previous one. This typically happens when an opener mark is expanded to cover whole range to the closer.