With the image derivative token in Drupal 7.20, the query string in the image style URL is now URL-encoded and no longer works.
The problem seems to be in the
hook_preprocess_image() approach. Changing the derivative URL scheme from 'http' to 'public' there seems too late, since now the 'http' URL has a query string and it gets encoded when
theme_image() converts it into an absolute URL.