A 52-YEAR-OLD father who collected almost 140,000 indecent images of children was caught when he tried to delete some of them at work, a court heard.

Daniel Baylis had some of the images on his phone but had to delete them individually - so he decided to download them onto his work computer to so he could delete several at once, Gloucester Crown Court was told on Monday.

But bosses at the American-owned firm for whom he worked were alerted via their software and contacted police.

Baylis, of Cheapside, Stroud, admitted 16 specimen charges of making indecent photographs or pseudo-photographs of children.

Most of the 138,728 images and 381 videos he collected between January 2002 and September last year were of the lowest level of seriousness.

But prosecutor Julian Kesner said 14 were at level two, two were level three and three were rated as the most serious level five.

The vast majority showed children in states of undress but not being abused, said Mr Kesner .

Baylis was trying to block-delete images using his work computer in Cirencester when his employers were alerted, the court heard.

He was arrested on August 30 last year.

The court was told that his wife was standing by him and was present in court.

Judge Jamie Tabor QC said: "You are now in your 50s and hitherto you have led as far as I can see a blameless and industrious life. "You are a married man with a family and with certain skills which you have been using in your employment.

"But you have been harbouring a dark secret for many years."

Jon Holmes, for the defence, said his client’s wife was standing by him and was in court – although she did not condone what he had done. Baylis was 'very remorseful,' he added.

"He has the support of his family and the support of his current employer - he is extraordinarily fortunate," added Mr Holmes.

Baylis was sentenced to a three year community order with supervision and must attend a course for sex offenders. He must also pay £500 costs.