How to get images into a slideshow via json javascript with new itok
Your root problem seems to be that you are using a side effect of image_style_url().

When you don't pass in a valid image path, you used to get back the basepath of the image style.  Now, with the token patch, it will include the token, and therefore not really be the basepath.  From what I can gather, this is why a lot of modules broke.

The proper thing to do is to use the API to create the URL for you on the server side, instead of gluing together parts in JS.  

This is something that I used on a recent project:

$images = array();
$styles = image_styles();

if (! empty($node-&gt;field_my_image[$node-&gt;language])) {
  foreach ($node-&gt;field_my_image[$node-&gt;language] as $image) {
    $fid = (int) $image['fid'];
    $uri = $image['uri'];
    $url = file_create_url($uri);

    $metadata = array(
      'alt' =&gt; empty($image['alt']) ? '' : $image['alt'],
      'width' =&gt; (int) $image['width'],
      'height' =&gt; (int) $image['height'],
    );

    $metadata['styles'] = array(
      'original' =&gt; $url,
    );

    foreach ($styles as $style =&gt; $unused) {
      $metadata['styles'][$style] = file_create_url(image_style_url($style, $uri));
    }
  }

  $images[$fid] = $metadata;
}

drupal_add_js(array('mymodule' =&gt; array('images' =&gt; $images)), 'setting');


This dumps all of my image fields into a JS array with all of their metadata, including all of the URLs for the image styles that I may need.  My JS code can then use what it needs from this array without worrying about building paths up.