working on select_photo function