After weeks of photographing protests in Philadelphia, artist and activist Sammy Rivera declared last month that he would no longer post his work on Instagram to shield protesters who might be targeted by police investigating property damage and disorder during the city’s massive demonstrations.

“I myself have found and been sent various photos of myself at the protests posted by other photographers, which indicated to me how easy it could potentially be for others to be tracked down and arrested or worse,” he said in a post on his Instagram feed on June 26.

His words were prophetic. Less than a week later, 23-year-old Rivera was arrested along with five other people, including a teenager, for allegedly vandalizing state police vehicles on May 30. Rivera did not immediately respond to a request for comment early Monday.

After investigators set out to find the people who had set fire to the vehicles, the FBI said it obtained photos showing six people attacking the state troopers’ cars, and then compared those photos to social media posts to identify the suspects. They were arrested last week.

That investigation, described in affidavits obtained by the Philadelphia Inquirer, echoes the worst-case scenario feared by many activists who have been urging people not to post protest photos online, where police can access the images and use them to make arrests.

“Recently, a couple people involved in the protests have been tracked down and arrested by police,” Rivera wrote in the Instagram post that preceded his own arrest. “Photos and video footage of the protests were used to pick out protestors, who were then identified and tracked down via their online/social media presence.”

He said he spent weeks photographing protests, but would leave those images on his hard drive until he could be sure that the police could not use them to target and arrest activists.

View this post on Instagram

Imma try and keep this short and simple. It’s been almost a month since the protests in Philly began. And over the course of the last few weeks I’ve been out documenting them when able. And in doing so I’ve built up a very large body of work that I am very proud of which displays the events that have taken place. However, I’ve begun realizing the potential negative impact of this documentation for the protestors involved. Recently, a couple people involved in the protests have been tracked down and arrested by police. Photos and video footage of the protests were used to pick out protestors, who were then identified and tracked down via their online/social media presence. I myself have found and been sent various photos of myself at the protests posted by other photographers, which indicated to me how easy it could potentially be for others to be tracked down and arrested or worse. So after much thought, in consideration for those involved I’ve decided I will not be sharing my work from the last few weeks. At least for the foreseeable future, until I can be assured of the protection of those involved and when I can come up with a way to properly present the work in a way that truly will aid/represent the cause rather than for my own benefit, the photos will remain in my hard drive. Until that time does come, I will share these few photos of police presence on the first day of protests; the first image being of officer Spillane unjustifiably pepper spraying various protestors, myself, and another photographer/reporter behind me, who were doing nothing but using our voices to exercise our right of free speech. Fuck that guy and fuck 12. I have so much anger for the corrupt system that continues to oppress and literally murder our people across the nation. And I hope all of you are angry as well. Please do not let the momentum of this movement die down. Keep going out to protests, keep signing petitions, keep donating, keep making your voices heard.

A post shared by Sammy Rivera (@sam.myrivera) on

According to the affidavits reported by the Inquirer, investigators received photos from an unnamed University of Pennsylvania student that allegedly showed a crowd attacking the cars and breaking the windows before setting them ablaze.

The police used distinctive tattoos, matching outfits and physical characteristics to connect some people shown in the student’s photos to protesters’ social media profiles, they said. Last week, police arrested Rivera, Luke Cossman, 20; Steven Anderson, 20; Francisco Reyes, 23; William Besaw, 21 and an unnamed teenager, WCAU reported.

Facial recognition software allegedly matched Cossman’s face to one of the vandals’ because of a small cross tattooed near his right eye. Anderson and the unnamed 17-year-old were Facebook friends with Cossman. Reyes posted photos of himself on Instagram wearing the same outfit as one of the men seen in the student’s photos, police said.

Rivera’s alleged role in destroying the squad cars was limited, according to court records. In the photos provided to investigators, Rivera can be seen taking photos of the incident with his own camera and allegedly let protesters use his skateboard to bust out windows, the Inquirer reported. Investigators said they matched the skateboard in their photo collection to one seen in photos posted to Rivera’s Instagram feed.

The police tactic of using photos published on social media and even in news publications has led activists to urge restraint from protesters, observers and some journalists.

It has also sparked a court battle between the police and journalists at the Seattle Times and four TV news stations in Washington state. Seattle police have demanded all of the photos and videos shot by journalists, including unpublished footage, in an area where squad cars were set on fire and businesses were vandalized. The journalists have resisted, but a judge has at least partially sided with the police, ordering the publications to allow the judge to review the images and decide which ones should be given to law enforcement officers. That decision is being appealed.

At the same time, many of the powerful images that have emerged from protests have evoked emotional responses and inspired further protest.

Photos and videos of police using batons, pepper spray and tear gas on peaceful protesters have led to widespread calls to change use of force and crowd-control policies. Scenes of federal officers mysteriously detaining people and shoving women linked arm-in-arm in a “Wall of Moms” led to a weeks-long standoff between thousands of residents and officers in Portland, Ore.

In Philadelphia, video of police tear gassing a largely peaceful crowd trapped on a freeway led the police chief and mayor to apologize and ban the use of tear gas on unarmed protesters. Footage showing an officer beating a protester with a metal baton led the police chief to suspend him with the intent to fire him after an investigation. And another Philadelphia officer now faces assault charges for pulling down a peaceful protester’s goggles and pepper spraying several people in the face as they sat passively on the ground, an incident captured in photos and video.