Refactors flickr media query