They included causing or inciting a child under 13 to engage in sexual activity, four counts of attempting to do the same and making indecent photographs of kids.

His crimes were ‘deeply unpleasant’, said the judge.

In total, Mackay had pleaded guilty to a total of 14 charges, including causing or inciting a child to engage in sexual activity. He was placed on the Sex Offender’s Register for life and subject to a sexual harm prevention order indefinitely.

Mackay preyed on young girls over the internet by getting them to send pictures of themselves in their underwear.

He then threatened to publish the photos online if the youngsters did not ‘comply with further demands’, which included videos of themselves engaging in indecent acts.

One girl from America, aged just 12, had to put up with his ‘threats and manipulation’ for a whole year.

Mackay demanded photos and numerous videos of her undressing or touching herself after he got her mobile phone number, and threatened to put it on the internet.

Two years later, he began hassling her again but police in Idaho began investigating and assumed the girl’s identity to catch Mackay.

Detectives then discovered he had targeted three other youngsters, all thought to be in the US, by threatening them in a similar way.

Indecent images of children aged 10 to 17 – including some at the highest level of depravity – were found when he was arrested.

Mackay argued his jail term was far too tough and that he had not been given enough credit for his guilty pleas.

But Lady Justice Sharp threw out his complaints, saying there was nothing ‘wrong in principle or manifestly excessive’ about his punishment.

The judge, who was sitting with Judge Johannah Cutts QC, concluded the appeal was ‘devoid of merit’.

Mackay was ordered to serve an additional six weeks behind bars for wasting court time.