added ability to use a url generating function with callback rather than fixed array of urls