A man who was caught photographing teenage girls outside a secondary school in St Albans has been sentenced for downloading more than 11,900 indecent images of children.

James Bentley, of Hopground Close, St Albans, admitted to “liking looking at young girls” after police found indecent images and movies of teenagers when they searched his home.

Officers had become aware of the 38-year-old following a report from students at Beaumont School that a man was sitting in his car outside the premises and taking photographs last February.

When they approached Bentley in the same spot the following morning he was arrested for a public order offence which triggered the raid at his property.

As well as 11,905 still images and movies rated at level one – the lowest level – 40 at level two, six at level three and 19 at level four, a Beaumont School prospectus was also discovered under his bed.

Prosecutor William Noble told St Albans Crown Court last Thursday: “He had admitted he found the girl on the front of the cover attractive and agrees she was 14 or 15 and had kept the prospectus for his own gratification.”

During a police interview Bentley also said he had taken photos of pupils outside Loreto College and Oakwood Primary School, and had been gathering pictures and footage of females for around 20 years.

Mr Noble added: “He was surprised by the number of level one images but put candidly said if you had been doing it as long as he had the amount was probably correct.”

He had an additional 58,000 images and 600 movies of girls and women “going about their daily business” at St Albans Central Library where he had worked for 15 years and at public parks and gardens.

Bentley, who subsequently lost his job at the library when his behaviour came to light, also explained on one occasion he had asked a colleague to pick up some leaflets and photographed her while she bent down.

Kate Smith, defending, asked the judge to take into account his early guilty plea to seven counts of making indecent images of children and three of possessing indecent images of children.

She said: “He recognises not only the impact of his behaviour on the community and on himself but on those closest to him.

“This serves as further motive for him not to reoffend in the future.”

Judge Marie Catterson passed a three-year community order with a supervision requirement and Bentley must complete a sex offender treatment programme.

She said: “It is clear from the [pre-sentence] report that you do recognise the need to radically alter your behaviour and address its cause.”

He was also handed a Sexual Offences Prevention Order lasting for 10 years, which comes with a number of conditions including not to take photographs of anyone without their prior permission and prohibits him from having unsupervised contact with a child under 16 unless a parent has given permission and knows about his conviction.