From time to time (especially when writing for the CloudFlare blog) I've needed to find an image that will help illustrate a piece of web writing. As I want to only use images to which I have a license and don't want to spend money the answer is... Creative Commons. And my first port of call is flickr which has nice options for searching for content by license.
Typically when using an image from flickr I will add a caption to the image with the license type, a direct link to the image page on flickr and a direct link to the person who took it.
For example, here are some Creative Commons cupcakes from flickr with an appropriate line of information about the image giving the license, image link and photographer.