NASA Image eXchange, or NIX, is a web based search engine into various NASA photo collections. As of this writing, it allows you to search over 300,000 images.
Because most of these images were taken on projects paid for by taxes, they are generally free of copyright. This is a good thing because it is beyond the budget of the average photographer to take a trip to the outer space. Anyway, there is a specific copyright notice on NIX, which states:
Photographs are not protected by copyright unless noted. If copyrighted, permission should be obtained from the copyright owner prior to use. If not copyrighted, photographs may be reproduced and distributed without further permission from NASA. If a recognizable person appears in a photograph, use for commercial purposes may infringe a right of privacy or publicity and permission should be obtained from the recognizable person.
The NASA Image eXchange can be found at http://nix.nasa.gov/. Another good place to search for space photography is http://www.nasa.gov/gallery/photo/index.html.