refactored flickrapi connection