IT was an intellectual bestseller of its day, the book every smart Glaswegian wanted on his or her shelf.

The Emotions of the Will, by Alexander Bain, pioneer of psychology and professor at Aberdeen University, might not set the heather afire today.

But for Victorian Scots, the book was cutting-edge thinking, a utilitarian guide to understanding right and wrong.

It is not clear if Alexander Thompson ever read the tome but he certainly signed it out of Glasgow’s then still new Mitchell public library. And he never signed it back in again.

For this – in an age that was perhaps not quite as enlightened as old Professor Bain might have liked – Thomson was jailed for nine months.

So this man – he was “shabby-looking”, according to the Glasgow Evening Citizen – came to be locked up in Perth General Prison. And here his image, along with other inmates, was captured for posterity.

This was Scotland’s original rogues gallery, a sepia snapshot of the nation’s troubled and troubling sons and daughters.

In the years before DNA or fingerprinting, Victorian authorities had what they thought was a surefire, pioneering means of identifying criminals: photographs.

And so in the very early years of the 1880s they set about taking hundreds of mugshots of inmates. Now, for the first time since, one of the very few surviving albums of criminals is being dusted down and exhibited in Aberdeen, for the city’s Granite Noir crime-writing festival.

The images, however, show more poverty than villainy. A spokeswoman for the organisers said: “Overwhelmingly, the crimes detailed are those of petty theft, fraud and assault. The frayed clothes of many of those featured hint at their low social status. At a time when portrait photography was in its infancy and most pictures of people were formal, studio images, this collection is a glimpse of a section of society that otherwise rarely features in images of the time.”

Thompson is not the only book thief to do hard time for his crime (he admitted he had previous and was caught when a librarian recognised his writing as he tried to sign out another volume of Bain’s work).

Pictured too was Jane Paul. She was given even longer for stealing even more edifying and morally righteous work, the Free Church Hymnal, in Dundee. True, Paul, had previous having also lifted some poems by Robert Burns.

Punishments for shoplifting were harsh – and the pictures demonstrated that women, including mothers, were regularly locked up.

One was Margaret Robertson, 35. She got nine months for stealing 18 bottles of porter from Strathbungo. The Evening Citizen reported her lawyer saying she had been on good behaviour since getting out of jail a decade before. “She had been leading a somewhat better life, and got married and had now one child,” the paper said. “On hearing the verdict, the prisoner burst into tears”.

Sentences did not seem fair, with wealthy offenders treated more leniently.

James Nicol Fleming, a director of the City of Glasgow Bank, only got eight months for “complicity in the notorious bank frauds of 1878”. This despite being found guilty of “falsehood, fraud and wilful imposition, as also fabrication and falsification”. He was described in court reports as looking ill. His mugshot, of a bearded well-dressed man, is one of those to be shown.

Ringleaders were treated more harshly. Helen Duffy was given six months. She was one of a number of women of ill-repute charged with assaulting and robbing Archibald Duncan, a Glasgow-based chief mate. He was attacked in the house of one Margaret McConnell. Duffy was sentenced to be imprisoned for six months, “that she might have an opportunity of reflecting”, said The Scotsman.

The paper added: “McConnell to be kept in penal servitude for seven years, his Lordship remarking that he had no doubt that it was her and the like of her who got hold of children and led them astray, destroying their lives, destroying them body and soul. It was plainly enough proved that she was the active party.”

Alexander Thompson, the would-be student of Bain, may think he was ill done to. But the authorities clearly took a dim view of those who do not return their library books. The sheriff told him: “Alexander Thompson, you took advantage of the valuable opportunities afforded to you as one of the public in Glasgow of going into the library to read, and you got out a book to read, but you took it away and appropriated it. That is a base theft.”

Criminal Portraits – Nineteenth Century Mugshots, Aberdeen Lemon Tree February 22-24.