I am not familiar with any common image format that has links in its spec... Apart from SVG, which is vector graphics.
In an SVG you can link using <a>
element. Here's an example:
<svg width="140" height="30"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<a xlink:href="https://developer.mozilla.org/en-US/docs/SVG"
target="_blank">
<rect height="30" width="120" y="0" x="0" rx="15"/>
<text fill="white" text-anchor="middle"
y="21" x="60">SVG on MDN</text>
</a>
</svg>
You can also embed a raster image using <image>
element and base64 encoded image data<image>
element and base64 encoded image data, then make it a link as per above. However, it might just be that whatever service you want to upload the image to has it restricted to formats like JPEG/PNG/GIF and won't accept SVG.
Otherwise, if you want a link stored and working in JPEG, PNG, BMP or GIF, then that's AFAIK not possible, as it's simply not in their specs.