Andrew Colvine also distributed two images with another person on the Kik social messaging site in which he talked about raping and carrying out sex acts on the girls.
Selkirk Sheriff Court was told that Robertson was jailed 14 years ago for downloading child pornography at a local library. His lawyer Ross Dow argued that his client had never received a community-based disposal which would assist his rehabilitation and added Colvine had a "personality disorder".
Sheriff Peter Anderson told Colvine he had a “weakness” and a “failing” and was concerned that the previous jail sentence had not shown him the error of his ways.
He said: “This kind of conduct is totally unacceptable in a well-ordered decent society."
Colvine, previously known as Andrew Robertson, was given a two-year Community Pay Back order with supervision and a requirement to carry out 200 hours unpaid work.
He was also put on the Sex Offenders Register for two years and is not allowed any contact with a child under 18 or ccess the Internet without the approval of his supervising social worker.
Colvine pleaded guilty to three charges of indecent images of under 18 years of age which happened between May 24 and November 24 last year.
He was found in possession of eight category B and C images which involved girls estimated between the ages of five and 14 in sexual poses.
Colvine, who gave an address in Galashiels, also distributed two of the images with another person on Kik social messaging site in which he talking about raping and carrying out sex acts on the girls..
The court heard that Colvine lived with his sister in Galashiels having previously resided in Newcastle.
But he moved back to Scotland following the break-up of his relationship with his partner.
Depute fiscal Joanna Waller explained that on September 27 last year he showed the partner a photograph of a child on his phone.
She explained: "The image was not indecent but it was not of a child he knew. The partner was aware of the accused's past and found it strange and contacted the police."
The enquiry was passed onto Police Scotland after Colvine had returned to Galashiels and on October 20 last year a search warrant was granted for his address in Galashiels.
A mobile phone lying on a couch was seized and following an initial examination it was found to be positive of the presence of indecent images with one category C and one category B.
The search also revealed a chat on the Kik message site between the accused and another user.
In total eight indecent images were found but only two were accessible.
The messages on June 27, 2020, on Kik involved a sexual conversation regarding children and the distribution of the images.
He was arrested and taken to Hawick Police Station where he confirmed the phone belonged to him and he had used a particular user name but denied the conversation had taken place or had distributed indecent images.
The fiscal said the images featured girls estimated to be aged between five and 14 engaged in sexual posing but there were no penetrative images.
The remaining six images – three Category B and three Category B – were inaccessible images.
Ms Waller said the search revealed the images had been distributed accompanied with messages where the accused was talking about rape and carrying out sexual acts on the girls describing the messages as "exceptionally crude".
She added: "The messages displayed an aggressive sexual interest in the abuse of children."
Sheriff Anderson warned Colvine the sentence was an alternative to custody and he was being given "one last opportunity".