Can you get the itok value programmatically? I appreciate the 7.20 security measure that requires a itok parameter for generating new images, but I need to expose that to Services / AJAX driven projects.

Can you get the image token programmatically so that JavaScript can build valid image urls for any size dynamically? 

I would like to avoid $conf['image_allow_insecure_derivatives'] = TRUE; unless someone has a project to apply this same security measure on a user session level as opposed to per image
It should be possible to get the token via a custom ajax callback that returns:

$token_query = array(IMAGE_DERIVATIVE_TOKEN =&gt; image_style_path_token($style_name, $original_uri));


From a custom menu router path or services callback.