I am not sure rules exist, but I'm happy to propose some:
If an image contributes facts and backgrounds to the question, do be sure to include one.
Images are practically mandatory on plant identification questions over on Gardening, for example. I can also imagine that UX or design questions that just described a user interface without a picture would be silly. Some CSS or other "why is this off by one pixel" questions need a picture to show what the problem is. On Movies and TV they are popular for questions about characters you might not remember by name. Puzzling leans heavily on them, too.
Never use an image of text where text belongs (the error message you're getting, for questions on a programming site, for example)
I hope this is self explanatory but image text can't be found with searches, can't easily be pasted elsewhere, and so on.
If the image is there only to inspire, uplift, or otherwise get to "asthetically pleasing", leave it out. We really aren't about asthetically pleasing.
If I could understand your question (and answer it) just as well without the cat, mountain stream, Facebook meme about footprints, cheerful cartoon about programming, or whatever, then just leave it out. If you don't, chances are someone will edit it out. Readers have limited time (and in some cases, space) and on all the SE sites, we optimize for efficiency, not for mood.
To be specific: the example you linked to is the third case and I would suggest not doing it. A picture of a happy dipstick level might be ok, since it gives context for answers that mention the overfill line or the minimum level line or whatever.
As for attribution, fair use, "but I gave credit" and so on, IANAL and if you're not sure, don't post that particular image at all. I restrict myself to screen shots I took, photos I took, and (on rare occasions) Creative Commons licensed pictures.