On a cold, rainy morning last January, Matthew Medlin hopped a freight car in downtown Portland, Oregon, and headed north. When he arrived at a train yard a few miles away, he felt something he said he often feels — a kind of magnetism that he's come to think of as a supernatural force.

Medlin is 33 and, when he's not behind bars, homeless. He has dagger-like stripes tattooed above his eyes and four dots below them — symbols of what he described as his belief in lycanthropy, the mythical transformation of humans into wolves. He's been a habitual methamphetamine user for years. He's schizophrenic.

In Medlin's telling, that something in the railroad yard was a person in danger. What followed, however, was not a rescue effort, but a five-hour standoff with police in which Medlin exhibited all manner of distressing behaviors, according to court documents: He tinkered with the brake system on a liquid propane car. He injected himself with methamphetamines. He pleaded with police to shoot him. He appeared to threaten them with shards of scrap metal.

The confrontation, which ended when one of the officers tasered Medlin, was an unusual one that no doubt would have made local news. But Medlin's story quickly spiraled across national and international media for a single reason: the series of mug shots he'd collected over the years proved irresistible. They portrayed a tragic, intensely visual parable. As the U.K. Sun put it, "Shocking mug shots reveal how methamphetamine and a life of crime ruined young man's model good looks."

In the burst of coverage that followed, there were scant details about Medlin's backstory — not who he was, where he came from, or that he denied much of what was contained in the court documents. Tiger Woods — whose eyes-at-half-mast mug went viral after he was arrested in Florida this summer for driving under the influence — can probably sympathize.

But why did we see these images in the first place? The simple answer is as routine as the booking photo itself: They're public documents. But there's a more complicated answer, too, since the U.S., paradoxically, professes a belief in blind justice while eagerly distributing photos of its accused. It's not that police departments in, say, England or Canada don't collect photographs of the people they've arrested; they just release them only when there's an important reason to. There's a jailbreak, say. Or a murderer on the loose. As Eddie Townsend, spokesman for the City of London Police, put it, "It goes back to the principle of innocent until proven guilty."

This strange cultural idiosyncrasy can be traced back more than a century, to when the photograph was among the lawman's most sophisticated criminal identification tools. But over the decades, the booking photo evolved into something quite different. Now the images are available from an expansive roster of mug shot purveyors — everyone from crime-fighting social media groups to privately run, online databases that, in some cases, have been described as extortion operations: They post booking photographs online, then charge exorbitant fees to remove them.

The result is a ubiquitous, frame-by-frame reality show depicting alleged crime and justice and starring the petty thief and the celebrity cokehead, the wrongly accused killer and the mentally ill drug addict. Free expungement clinics help the more desperate among them scrub their criminal records, while firms like EraseMugShots​.com offer "removal" services for a fee.

Lawyers in Illinois, Florida, and beyond have taken their grievances to court, and lawmakers in more than a dozen states have tried reeling in the more pernicious practices of some mug shot entrepreneurs, Last year, a panel of federal appeals judges weighed in on the whole internet-fueled enterprise, denying a newspaper's request for U.S. Marshals' booking photos.

"Mug shots now present an acute problem in the digital age," wrote the 6th U.S. Circuit Court of Appeals' chief judge, R. Guy Cole Jr. "These images preserve the indignity of a deprivation of liberty, often at the (literal) expense of the most vulnerable among us."

It wasn't always this way. What began more than 150 years ago with "wanted" posters and rogues' galleries had, by the last decade of the 19th century, evolved: In Paris, the records clerk turned pioneering criminologist Alphonse Bertillon developed the modern booking photograph — one frontal shot, one profile — and in the U.S., the argument for mass distribution came from one of the country's most celebrated inspectors, the New York Police Department's Thomas Byrnes. In Byrnes' seminal 1886 collection of 204 images, Professional Criminals of America, he described the practice as crime prevention par excellence, a system where there weren't just a few sets of eyes surveilling a new class of elusive criminal, but thousands.

With the emergence of crime-and-celebrity-driven media, the mug shot became a staple of American culture. It could distill a historic moment like the arrest of O.J. Simpson, said Jonathan Finn, a professor of communications at Wilfrid Laurier University and author of Capturing the Criminal Image: From Mug Shot to Surveillance Society. "There are thousands and thousands of mug shots," he said. "But O.J. is O.J."

Then the internet happened. Sheriff's offices in large and tiny counties alike now post mug shots to slick, constantly updated websites. Under its notorious former sheriff, Joe Arpaio, Maricopa County even held a contest in which visitors voted on a mug shot of the day.

Local TV affiliates offer them in slideshows, while Arrests.org lets readers tag and comment on them. Jailbase.com shuffles them through a smartphone app, and TheSmokingGun.com assembles them into all manner of categories that include "cleavage," "fogeys," and "B-List."

Even the Tampa Bay Times, which prominently displays its Pulitzer Prize tally (12), compiles them alongside a list of physical attributes: gender, height, weight. The images vanish after 60 days from a section that clocks nearly 1 million views a month, said the paper's editor, Neil Brown. While he put the site's news value at the "lowest possible level," he said that such eyeball-grabbing schemes aren't unusual. "The slippery slope of being a purist is that there's all kinds of stuff on news sites all over the country that is there for the interest of the audience," he said. "I don't think sanctimony over it is entirely well placed — though I don't begrudge anyone their sanctimony."

Why are people so obsessed with these photos? Rutgers sociologist Sarah Esther Lageson, who has been studying the explosion of digital mug shots for nearly a decade, said that they offer a view not just into the darker recesses of someone's life, but into an essential government process that many of us never see or experience. It's also a public act of shaming, she said: "It helps us draw a line around what's acceptable."

To Trevor Whipple, the police chief in South Burlington, Vermont, the mug shot was a powerful means of transparency — at least, that's what he thought when his department began posting them to its Facebook page a few years ago. As he put it, "Who are we arresting? Profiling is a significant concern. This is: We'll let you see everyone" in custody.

Then came the angry phone calls from people who'd been arrested and then cleared or had their charges expunged. In one case, Whipple said, a mother called about her 19-year-old daughter, whose DWI arrest had produced a tear-and-mascara-streaked image that was being repeatedly reposted. "She said, 'My daughter — this was the low point of her life, but people keep going to her mug shot on your Facebook,'" he recalled.

All of this gave Whipple pause. How, he thought, will these images affect someone who shouldn't have been arrested in the first place? In the end, he said, it was the comments that did it. "We saw people playing off personal characteristics — 'He doesn't look smart. He looks like a doofus,'" Whipple recalled. "I thought, 'Have we run out the usefulness of this? I don't want to have people humiliated.'" On July 4, 2015, after a roughly yearlong experiment in social media transparency, Whipple posted a note on his department's Facebook page declaring it dead.

Whipple's concerns weren't misplaced. Lageson interviewed 27 people at Minnesota expungement clinics over two years beginning in 2014 and found that people had been fired and rejected from jobs — or scared to even apply in the first place. One woman had been unable to find decent housing; another was kicked out of her church. The photos were decades old, in some cases, and the people pictured in them had no idea they were online until they "popped up," as Lageson recalled many of them saying.

Most of the people Lageson interviewed didn't bother contacting the sites that were publishing their images. They had been too overwhelmed or confused about whom to contact; some thought it wouldn't do any good. Consider MugShots.com, for instance, which describes itself as a "search engine for Official Law Enforcement Records" — a mission it says is protected by an assortment of federal and state laws and two constitutional amendments.

Not everyone has been chastened by this seemingly impenetrable legal defense. In Illinois, three men seeking class-action status filed a suit last year describing the site as an extortion racket that deliberately and routinely published inaccurate information for a single purpose: to drive people to a prominently advertised "sister" site — UnpublishArrest.com — where, for removal services, they spent anywhere from $399 (for a single arrest) to $1,799 (for five).

"They were deliberately trying to use this information as a cudgel to beat people with because they are desperate enough to pay that kind of money," said Stuart Clarke, one of the lawyers who filed the suit.

A lawyer for MugShots.com, David Ferrucci, denied this, insisting in an interview that the site is as much a crime blog as anything else. As evidence, he pointed to aggregated posts on its homepage about accused sexual predators and murderers, and compared it to the Chicago Tribune's "mugs in the news."

Besides, Ferrucci added, shouldn't the focus be on the draconian elements of our justice system — and not the pictures of the people it locks up? "Instead of shooting the messenger, the purveyor of the public records, maybe we should lessen the impact of the prison industrial complex," he said. "That's really the tragedy here — how easy it is to get arrested."

Lawyers like Ferrucci and sites like MugShots.com aren't the only ones fighting for continued, broad access to booking photos. Journalists are, too. In 2013, the Detroit Free Press sued the Justice Department after it refused to release mug shots of four police officers accused of corruption.

Dozens of news organizations and press advocacy groups backed up the newspaper in court, including the Reporters Committee for Freedom of the Press. A lawyer there, Adam Marshall, defended the mug shot as a memorialization of one of the most important processes of the criminal justice system: the arrest. "There are a whole bunch of details the photo can give us," he said. What if the police arrested the wrong person? What if the officer assaulted that person? "The public expects information from the government about what they're doing," Marshall said. "The photo provides the public with that information in a way that a name doesn't."

Back in Portland, inside the drab interview room of Multnomah County's downtown jail, Matthew Medlin wasn't sure what to think about how his mug shots had turned him into a grim kind of celebrity. He viewed the images, in part, in those terms — "It's kinda cool that I'm being glorified a little bit," he said — though he hoped their impact wouldn't stop there. "If there's a reason or a chance that this can actually benefit me, or people like me," he said, then "maybe somewhere down the road it'll help us get the help that we need."

That remains to be seen, but Medlin seemed hopeful about his prospects. For the first time in his life, he had been moved from a jail cell to Oregon's main psychiatric hospital in the state capital, Salem, where he was signing up for classes on, among other things, how to deal with cognitive mental illness and how to defend himself in court. "It's just a good rehabilitation vibe," he said. "It's well needed, I think."

Excerpted from an article originally published by The Marshall Project. Reprinted with permission.