|"getting ready for the science fair" by woodleywonderworks, CC-BY 2.0|
If it's from a database, you can use the databases's citation tools to generate one, but what if you found it on Flickr? What if you found it searching Google?
Well, it depends on where it came from. Has the picture always lived online? Is the original copy of the image on display in a museum or in an archive? Is it a reproduction of an image from another work? These are the deep questions we must ask ourselves. For some common examples and how to cite them in MLA style, check out the Cite It, MLA Style: Images Edition handout.
As usual, the Purdue OWL has advice on the topic for MLA, APA, and Chicago citation formats, or if you're using NoodleTools and MLA, try this flowchart to help you determine how you'll cite the image.