I tried to do some research into this awhile ago. What I found is that you (generally, kind of) are able to use copyrighted work to make another work as a "transformative work". For example: you can look at an image of a person and use that as _inspiration_ to draw the same person (as long as you aren't tracing). However! that's still kind of a gray area.
ALSO: how does that apply if you are using the exact pixels of 1,000,000 images to make new ones? I don't think anyone has a definitive answer yet.
My guess is that it will have to be decided in some high profile court case before we get real answers :)