OK, this is my proposal (don't know, why I didn't send a patch in the first place...). If a caption is provided, wrap the image as before. If no caption is provided, just insert the image tag.