What is Child Pornography?
Under federal law, child pornography is defined as any "visual depiction" involving "the use of a minor engaging in sexually explicit conduct." Not all nude photos or movies involving children are illegal child pornography. The depictions must be "sexually explicit" which includes images of sexual activity as well as "lascivious" displays of the genitals. In a close case, it may be up to either the judge or the jury to figure out if an image is "sexually explicit." In practice, though, most of the material prosecuted is unambiguously pornographic.
Knowingly possessing, producing or trafficking in images of actual children engaged in sexual activity is a crime under both state and federal law. Federal law defines anyone under 18 as a child for these purposes. Under New York law, possession of a "sexual performance by a child" under 16 is a felony; promotion of a sexual performance by a child under 17 is also a felony. The First Amendment provides protection to defendants, but only where no actual child is involved in the production of the image. Images of actual children, even morphed images of real children, are not protected by the First Amendment.
At the same time, because of the First Amendment, child pornography offenses are not "strict liability" crimes like statutory rape: in order to convict a defendant, the government must prove that the defendant knew the material involved the actual abuse of a child (in statutory rape cases, it is know defense that the defendant did not know the victim was underage). In most cases, though, knowledge can be proven easily if the photograph is realistic and depicts a young child. Again, close cases may be decided by a jury.
While state laws vary, the Department of Justice publishes a Citizen's Guide to U.S. Federal Law on Child Pornography, which is available here.