Move code for downloading photos to separate class.