A 22-year-old man has been jailed for two years at the Edinburgh Sheriff Court after pleading guilty to possession of indecent images of children.