Simon Black, 37, from Cardenden, Fife, and his ex-partner used chat rooms to find “like-minded couples” to have group sex with.
It was on one of these chat rooms that Black – under a pseudonym – started talking to a woman from Derbyshire.
She reported him to police after the conversation turned towards children, and when officers visited his house they found the indecent images on his computer.
Black pled guilty at Edinburgh Sheriff Court in October to owning 391 indecent photos and four videos of children between January 2008 and August 2009.
Depute Fiscal Gerard Drugan told the court then that suspicions were raised after the conversation between Black and the other chat room user became paedophilic.
While talking to the woman – using the name Carole Storey – Black referred to a fictitious baby daughter and the woman’s baby son taking part in a sex act.
Sick fiction
Mr Drugan said: “The discussions between ‘Carole’ and this lady were of a sexual nature.
“The lady became concerned when ‘Carole’ began to suggest sexual activity with his fictitious baby daughter and the lady’s son – between children, the lady’s real son and his fictitious daughter.
“He then described sexual conduct with the child.
“This was all a fiction. However, the lady became concerned and reported matters to her local police.
“An enquiry was passed to Lothian and Borders Police and the messages were tracked back to the computer used by the panel.”
When police visited Black’s house in the Sighthill area of Edinburgh they confiscated a computer, laptop and diary which contained references to more paedophilic chats as well as the indecent images.
Mr Drugan added: “The diary and the computer made reference to similar paedophilic chat.
“The computers were examined for the presence of paedophilic images in both still and movie format.”
Almost 400 still and moving images were recovered from the computers including seven at the highest level and four films.
One of the more serious images showed an adult male having sex with a young girl as young as three, and one even showed a child being urinated on.
In all of the images the children pictured were aged between three and eight.
‘Not a victimless crime’
Defence agent Jennifer Cameron said that Black had co-operated with police from the beginning and went on to say that some of the images had been deleted when they were found by officers.
Miss Cameron said: “There is a table that breaks down accessible images and inaccessible images.
“The inaccessible ones are the ones he did not have access to. Some had been deleted and were not accessible to Mr Black.
“It should also be noted that the majority of the images on his computer (294) were of the lowest level (level one).”
Black was also given an extended sentence of four years and was placed on the sex offenders’ register indefinitely.
Sheriff Isabella McColl said: “This is not a victimless crime; these are real children being harmed who are suffering real pain.
“Considering the types of images on the computer – including one which depicts a child being urinated on and one showing an adult male having penetrative sex with a girl as young as three – I feel I have no other option but to impose a custodial sentence.”