A man has been jailed after he pleaded guilty to secretly filming naked men in a Virgin Active gym changing room and then uploading the pictures onto social media.

Stuart Hamilton, 37, from Gorgie, Edinburgh, was sentenced to 13 months in jail for taking photographs of naked and semi-naked men at the Virgin Active gym in the Fountainbridge area of the city.

A member of the gym for five years, he posted the images on an Instagram account under the name of RugbyLover79 between February 2014 and July 2015. One of his unsuspecting victims discovered his image had been uploaded to the internet after speaking with another member of the gym.

Fiscal depute Kim Schofield said: "Around April 2014 the complainer was approached by another gym member who made him aware of an Instagram account under the name of RugbyLover79.

"That account had a number of pictures of famous rugby players. There was also a number of pictures of the complainer at the locus. One picture of the complainer was a profile of his body, naked while in the changing rooms."

The man reported the matter to Virgin Active management, but not to the police. However, a year later, Hamilton reportedly tried to obtain the contact details of the man he "found attractive" via a female friend of the victim, who he had tracked down on WhatsApp. However, she grew suspicious when he remarked that he went to the same gym as her friend who he "liked to see naked" and reported him to the police.

During a police interview, Hamilton gave a "full and frank admission" and "indicated he had taken naked photographs of men at the gym without their knowledge". Police found the naked pictures and other photos of "unidentified males in their underwear, [at] various stages of undress and in the showers".

Hamilton missed his initial court date, scheduled for last September. He was spotted in a London park by a work colleague and sent back to Scotland to face the indecency allegations in court in December last year.

According to Mail Online, Hamilton's solicitor, Robert Low, told the court that his client's actions were "out of character" and he had been going through a "particularly stressful time in his life" and he had shown "remorse" for his actions.

Sheriff Thomas Welsh, who sentenced Hamilton, told him: "This is a very serious offence and was a gross invasion of privacy of various people who were photographed. In those circumstances only a custodial sentence is appropriate."

The 37-year-old was found guilty of taking indecent images and sentenced to 13 months in prison and placed on the sexual offenders register for 10 years.