PicRepository and random functionality