I need to add to the previously closed post: https://forum.getpublii.com/topic/image-links/
I found the issue. Once you insert an image and you add a link, if you edit the image afterwards and enable the caption, the link is lost. Also it does funny things when you enable the caption upon adding the image and you add the link after that.
Publii 0.37.1
macOS Mojave
Editorial