A 'socially isolated' man who collected scores of images of distressed children being raped has been spared jail.

James Johns had 166 files, which included 37 movies, from like minded people he contacted via the Kik Messaging service. But after hearing the 24-year-old was suitable for treatment a judge said it was better he was stopped from reoffending than sent straight to jail.

Colin Meeke, prosecuting, told Swindon Crown Court that police received intelligence linking his IP address to indecent images of children.

In February they went to his home in Foghamshire, Chippenham, and after telling him why they were there he replied that his Microsoft account had been hacked years before.

He insisted that officers would find nothing compromising on his machines but when they looked, they found 166 images, including 89 in the worst category,

"These messages were all sourced by KIK Messenger," Mr Meeke told the court.

"Evidence in the internet search history of some of the rather well known sordid terms people use in search engines to look for it.

"He accepted he would source the material from a website then have direct chats with other persons with similar interests on KIK Messenger.

"He said he was not sexually aroused by the material but at least it would allow him to feel something rather than numb.

"All the images are children under 13 years of age. Many show children in distress and pain from that to which they are being subjected."

Although he had not been charged with distribution, Mr Meeke said there was a suggestion the defendant had shared some of the material with others.

Johns pleaded guilty to making indecent images of children.

Nick Fridd, defending, said "This is a rather sad and lonely and, the term used in the pre-sentence report time and time again, socially isolated man.

"He comes from a good family. He is supported today by his mother. You can imagine the shock to his family having had to admit to them and coming to terms with what he has done."

Passing sentence Judge Jason Taylor QC said: "On February 4 police attended your flat having received intelligence.

"When they informed you of the reason they were there you tried to come up with an excuse. You said they wouldn't find any indecent images of children. Well they did.

"There were 89 A, 30 B and 47 C making a total of 166. That included 37 moving images. Your internet search history shows an interest in underage girls, especially preteens.

"I am satisfied you will benefit from a sexual offenders' programme but more importantly society will benefit from it if it can stop you offending again."

He imposed a two year jail term suspended for 24 months and told him to complete a sex offenders programme.

Johns must also register as a sex offender and abide by a sexual harm prevention order for ten years.