A former Stevenage headteacher, who returned home after a day in the classroom and looked at indecent images of children online, was today spared jail.

Chelmsford Crown Court was told that Miraz Triggs, of Elmdon near Saffron Walden, also talked to other perverts and shared some images in chat rooms where he was known as ‘Mad Max 382382’.

The 46-year-old – of Ickleton Road – was formerly assistant head at Stevenage’s Barnwell School and head of the Da Vinci Studio School of Science and Engineering, and had a brief stint as head of St Albans’ Batchwood School.

When police raided his home in June last year he was working as a supply science teacher back at Barnwell School.

Police found more than 21,000 indecent images on his computer, and today Judge Emma Peters branded his behaviour as “horrific and appalling.” She imposed a suspended jail sentence after she said she had struggled with how to sentence him.

She said: “The idea that a teacher, who has spent decades educating children and indeed has led others when occupying senior management positions, could come home from school, get on a computer and derive sexual gratification from seeing the abuse of children is an idea which is horrific and appalling.

“Those of us who are parents send those children to school expecting them to be educated by those who have a well-set world compass and by those for whom the concept of child abuse can be nothing but a complete anathema.

“That is why when a teacher appears in the dock it gives somebody in my position a great deal of pause for thought because it seems so much more awful that you are a teacher – or were.”

Triggs pleaded guilty to six offences. Three related to making, or downloading, indecent images of children at the A, B and C categories between October 2016 and June 2017.

There were 33 photos and nine movies at the highest level A; 150 images and 24 movies at B; and 21,058 images at C. The huge number were contained in zipfiles and not downloaded individually.

He also admitted distributing indecent photographs of children, nine at category C; possessing an extreme pornographic image involving an animal; and a charge of possessing a prohibited image, a cartoon.

He was sentenced to 18 months’ imprisonment, suspended for two years, with 50 days rehabilitation activity requirement and 240 hours’ unpaid work.

He will never teach or work with children again and will remain on the Barring List indefinitely. The judge also made a sexual harm prevention order which allows police to monitor his internet devices, and he will have to sign the sex offenders’ register, both for 10 years.

Judge Peters told Triggs as she sentenced him she had to decide “if you were not a teacher what would I do and because you are, or were a teacher, should I do otherwise?”

She added: “That’s why I struggle to answer that question.

“I have come to the conclusion that to send you to prison merely because you are a teacher is to descend to levels of retribution which this court should rise above and this court should have more regard to the protection of children in the long term and rehabilitation in the long term.”

She added that Triggs’ punishment came from standing in the dock, being “pilloried” publicly, having been ostracised by friends and to know that he had lost the career and vocation he loved.

Prosecutor Peter Gair said police executed a search warrant at Triggs’ Elmdon home on June 9 last year. The images were found when his computer was analysed. He had also deliberately searched for illegal indecent images of children, predominantly girls, using phrases such as “legal tiny teens” and “amateur teens”.

Triggs used specialist software to search for indecent images of children on websites, many of which had now been rendered inactive, he added.

Mr Gair told the court: “There’s evidence that on a number of occasions he entered into chats with like-minded people on Skype which involved sharing category C images of children clearly for sexual gratification.”

Initially Triggs denied involvement in any of the activity saying they had been “pop ups” when he was searching for adult porn.

Mitigating, Sarah Vine said: “These are difficult offences to admit to involving as they do total reputational ruin. Certainly in this case the exodus of friends and associates and the abrupt end to an impressive career.”

She added: “He led effectively a double life, hidden entirely from view. It was described in his pre-sentence report as a sexual preoccupation which dominated his life. His knowledge it was imperative to keep these activities secret was something which meant it was always with him.”

Miss Vine said Triggs, who had lost his former career, had been paying for his own rehabilitation counselling and courses to try and understand what led to his behaviour.

He was trying to make amends, she said. He had worked in a charity shop until his arrest became public and left to avoid the charity’s embarrassment. He had redecorated the room at home where he used his computer. An accomplished trombone player, he had even gone busking to keep busy and raise money so his wife was not the only earner.

His wife had written the court “a powerful” reference, as had friends who still supported him, she added.