Get the image by logic

I would like to ask the function about display the image by logic

I have 10 photos in google driver, I hope to display the image systematics.
For example, show 3 photos in sam phone, show 3 photos in andy phone, show 4 photos in mary phone, I have no idea how to do it

First get all the photos from gdrive then use if else block . If Sam is logged in , then show the photos named with such name(applicable to one and all)

Thank you very much. I am trying to do already and do you have similar sample for reference? It is easy for our mind to talk it but there may be difficult in kodular