Posts should be self-contained, i.e. not depend on external links.
If it is dependent on the link, it should have some version of the relevant content edited into the question (which can also be done with images) or be closed. You probably want to keep the link for attribution.
If it's clearly just an attempt to spread the link (especially if the question isn't at all on topic), it should flagged as spam.
If the link isn't relevant at all, it should just be edited out. Although possibly not if the link is clearly spam but it looks like a legitimate question without the link. In that case you probably want to just leave a comment making the issue clear and flag it as spam. Or edit it out and use a custom flag to explain the situation.
Links here are
nofollow, as noted in the other answer, so this isn't an issue for search engines. But you still don't want users visiting the question and clicking on the link if it's spam.
Regarding these examples, I'm not too suspicious about them, mostly because they come from established users who've both asked legitimate questions on other sites. If it weren't for that, I'd have been more inclined to say it might be spam, but those judgements aren't always easy to make and can be wrong (case in point).
In this case the image could just be edited into the question, although that might not be worth it when the question is closed (as that would bump it and might send it to review).