flickr integration and short javascript refractor