Two rapists who filmed their attack on a woman in Fraserburgh have lost their appeal against conviction.
Justinas Gubinas, 23, and Nerijus Radavicius, 30, were both jailed for four-and-a half years last year.
Co-accused Ovidijus Kavaliauskas was found guilty of raping the woman while she was asleep.
Gubinas and Radavicius appealed, claiming the jury had been misdirected about how they could approach the video images taken on phones.
The offences took place in a farmhouse in 2014 where the three men were staying at the time.
The woman had agreed to go back to their house.
All three denied rape and claimed that the woman had consented to sex with them.
Form a judgement
An element of the legal challenge was referred to a bench of five judges, including Scotland's two most senior judicial figures, the Lord Justice General and the Lord Justice Clerk.
They maintained that the trial judge, Lord Armstrong, had misdirected the jury on the way in which they could approach the video images taken on their phones.
The judge had told the jury to form a judgement about what the footage shown at the trial revealed and to form their own conclusions about what it depicted.
Defence lawyers argued that it was wrong to tell jurors that they could form their own view of what the images demonstrated.
The footage showed the woman in an intoxicated state and at one point in the accompanying audio recording she could be heard saying "no".
Lord Carloway, who heard the appeal with Lady Dorrian, Lord Menzies, Lord Brodie and Lord Turnbull, said: "Once before the fact finder, the recording's content is available as proof of fact.
"The fact finder is free to make such inferences from the audio or video components as would be open to any judge or jury hearing oral testimony descriptive of the same events. This does not convert the fact finder into a witness."
The senior judge said that once the provenance of images was established it became real evidence which a jury could use to establish fact, irrespective of concurring or conflicting testimony.
"Even if all the witnesses say that the deceased was stabbed in the conservatory, if CCTV images show that he was shot in the library, then so be it," he said.
Lord Carloway said the judges had paid particular attention to the sound reasoning of a Canadian Supreme Court decision which he said represented "an enlightened and sensible approach to video or audio recordings".
In the Canadian case a judge said: "So long as the videotape is of good quality and gives a clear picture of events and the perpetrator, it may provide the best evidence of the identity of the perpetrator."
Lord Carloway said the trial judge's directions to the jury were generally correct.
"The direction to the jury to form a judgement about what the images showed, just as if they would form a judgement about eye witness descriptions of what happened, was correct," he said.
"The statement that the jury could draw their own conclusions about what the images depicted was also correct."