In HTML, you add a tag around img.
Same for markdown
Image:

Link:
[Alt text for broken link](httsp://example.com)
Image with link:
[](https://example.com)
Note the link on the outside doesn’t have alt text anymore but the link still wraps the image.
Yes it is hard to read and edit but you get used to it as a pattern in markdown
It is not valid to break it over lines, but to demonstrate the syntax I’ll do it
[

](https://example.com)