upstream magic
calling api for photos recursively