A man secretly filmed fellow gym users while they were naked in a changing room and posted them on Instagram.

Stuart Hamilton took the footage of men of the Virgin Active complex at Fountain Park in Edinburgh over an 18-month period.

The 37-year-old was jailed for 13 months and put on the sex offenders register for ten years at Edinburgh Sheriff Court on Thursday.

Sheriff Thomas Welsh QC described his actions as "a gross invasion of privacy".

Hamilton had previously admitted filming members of the Virgin Active club at Fountain Park between February 1, 2014, and July 2, 2015, and failing to appear for a court hearing in September last year.

Fiscal depute Kim Schofield had told the court one of the gym members was told naked pictures of him had appeared on Instagram under the title "Rugby Lover" along with pictures of famous rugby players.

He reported this to the management but not to the police.

In May 2015, however, the man was told by a friend that naked pictures of him had been shown by Hamilton, who said he went to the same gym and that he found the other man attractive.

The friend managed to get Hamilton's mobile number and gave it to the victim who then contacted the police.

Defence solicitor Robert Lowe told Sheriff Welsh his client had cooperated fully with police and expressed remorse for his actions.

Hamilton, who had no previous convictions, had not attended the court hearing in September because he had been "very distressed".

Mr Lowe added Hamilton's father died last week. A social work report said the risk of Hamilton re-offending was at "the lower end".

Sheriff Welsh said he accepted Hamilton had health problems but said only a jail sentence was appropriate.