Two dimwitted crooks used a stolen cellphone to shoot selfies — and the pictures were automatically uploaded to the victim’s photo-sharing account, police said Thursday.

Now cops are using those images to hunt down the shutterbugs.

The thieves had swiped the cellphone from an 18-year-old man on Seventh Avenue near West 117th Street in Harlem on Sept. 24 at around 8:30 p.m, police said.

A short time later, they staged their own photo shoot.

In one of the vanity shots, a man is seen leaning against a car and flashing what a source said was a Crips gang sign.

He is wearing a black Lacoste hoodie.

The other shot is a close-up of a man who is also wearing Lacoste and has a pair of earbuds in.

The pictures went to the phone owner’s account with iCloud, Apple’s data-sharing system that stores photos, videos and music.

The men’s reckless vanity came as no surprise to law-enforcement sources.

“It’s funny . . . most times in cases like this the perp is throwing up gang signs,” a law-enforcement source said.

“[It’s] the mentality of some of these kids . . . It’s all about affiliation. It’s like they boost themselves up for street cred. It’s a ‘Look what I did’ mentality,” the source said.

“The girls usually post selfies, and the guys will throw up gang signs in theirs. Or they’re twerking.”

The duo ripped off at least three others in the area, in some cases demanding their cellphones at gunpoint, police said.

On July 29, the crooks demanded 55-year-old man hand over his cellphone as he walked into his apartment at around 3:45 a.m., cops said.

At 11 p.m. the same day, they pulled a pistol and demanded a 29-year-old victim’s cellphone on West 116th Street near Eighth Avenue, according to police.

On Sept. 19, they pretended to have a gun and did the same to a 17-year-old, police sources said.

Cops are still hunting for the suspects.

The gadget-swiping punks — who sources say have a history of stealing phones in the Harlem area — aren’t the only crooks undone by their own vanity.

Last year, a Bronx man who swiped a cellphone from a 27-year-old woman in March snapped a photo of himself staring squinty-eyed into a cellphone lens while surrounded by a thick cloud of pot smoke, a police source said.

The bandit then accidently uploaded the photo onto the phone owner’s Facebook page.

Once the owner realized the man was likely the jerk who swiped her phone, she handed the photo to cops.