Moved getPhotos block to main thread