A primary school teacher who hoarded thousands of indecent images of children has been jailed indefinitely.
Richard Michael Watkins, 29, used a spycamera hidden in a pen to take pictures of children getting changed for PE lessons.
His home in Braemor Road, Calne, was raided by Wiltshire Police officers following a tip-off from Interpol.
Swindon Crown Court heard they found a laptop containing 23,433 indecent images.
Three videos and 234 pictures were level five, the most serious grading of abuse, the court heard.
Watkins, admitted 11 charges of possessing and making indecent images of children and two counts of voyeurism at an earlier hearing.
He will be eligible for parole in two years, but will not be freed until he is considered not to be dangerous.
The court was told an internet company in Luxembourg had discovered a website using its services was hosting child pornography.
Watkins’ computer IP address had accessed the website and his details were passed to Interpol.
Wiltshire Police officers raided his home in November last year, while his wife was pregnant.
The court heard Watkins had confessed immediately when they arrived. He resigned as a teacher at Derry Hill Primary School in Calne after his arrest.
Sentencing him, Judge Douglas Field said: “You are a school teacher and have been teaching young children, and you surreptitiously took pictures of them changing for your own perverted sexual gratification.
“Without treatment you are particularly dangerous to young children, especially pre-pubescent girls.
“I conclude from the reports I have read and the facts of the offences that there is a significant risk to members of the public of serious harm.”
Watkins was placed on the sex offenders’ register and banned from working with children for life.
A statement made by Det Supt Sarah Bodell on behalf of Wiltshire Police and Wiltshire Council said: “It is important to state that while the voyeurism charge relates to his actions within the school, it did not involve indecency, and the charges relating to the indecent images did not involve children at Derry Hill.
“Nevertheless, viewing and downloading indecent images of children is child abuse. It fuels a worldwide demand and leads to further abuse of innocent children.”
The statement added that police and the council thanked staff and parents at the school “for their continued assistance and understanding in what has been an emotive and complex investigation”.