Adjust URLS for MediaTable, change JS to use drupal behaviours