A British spy agency collected millions of still images while eavesdropping on Yahoo webcam chats by citizens of the U.K., the U.S. and other countries, according to a new report Thursday.

Citing documents leaked by former NSA contractor Edward Snowden, the Guardian reports that the British program known as “Optic Nerve” was designed to test and improve the agency’s facial recognition software capabilities. According to the documents, the British spy agency GCHQ snooped on “unselected” Yahoo users—that is, people who were spied on at random regardless of whether or not they were suspected of any wrongdoing—during webcam chats and took millions of still shots at five-minute intervals. The GCHQ does not have the technical capability to ensure that no images of British or American citizens were included in the bulk collection, the Guardian reports, and proper legal authorization is required for GCHQ to conduct data searches on people likely to be in the U.K. at the time.

In sorting through the massive amount of information it collected starting in 2008, when Optic Nerve first launched as a prototype program, U.K. spies were met with an explicit challenge: pornography

“Unfortunately, it would appear that a surprising number of people use webcam conversations to show intimate parts of their body to the other person,” one document leaked by Snowden says. “Also, the fact that the Yahoo software allows more than one person to view a webcam stream without necessarily sending a reciprocal stream means that it appears sometimes to be used for broadcasting pornography.”

The GCHQ estimated that between 3 percent and 11 percent of the images it vacuumed up were of an explicit nature, and it wrangled with the challenge of how to protect analysts’ eyes from an onslaught of pornographic images.

When informed of “Optic Nerve” by Guardian reporters, Yahoo disavowed any knowledge of the program and expressed outrage at the intrusion.

“We were not aware of, nor would we condone, this reported activity,” a Yahoo spokesperson said. “This report, if true, represents a whole new level of violation of our users’ privacy that is completely unacceptable. … We are committed to preserving our users’ trust and security and continue our efforts to expand encryption across all of our services.”

Yahoo has been among the most vocal of tech companies protesting the NSA’s mass surveillance activities.

[Guardian]

Contact us at letters@time.com.