encapsulation the code of get photo simply