How to buy cheap, legal images for your website

Just typing a subject into Google Images and grabbing something appropriate is one way of getting images for your projects, but it's not the best idea if what you want to avoid a lawsuit.