D7 image filenames – simple query

Simple query hopefully, but I’m completely flummoxed.

I’ve got a site which loads images from external locations and caches them locally (using imagecache_external).  Somehow in that process it changes the filename of the image from “samplefile.jpg” to something like “9c811dbd8564a2ff551b00a3f74ca503.jpg?itok=FZzLR3QD”.

In entirely non node-based code I need to do some analysis of the image files, but I just can’t tell how to derive the new (local) filenames.  I’ve searched the DB and can’t find the new names or (itok) anywhere.   Anyone got any ideas, or can point me in the right direction?

Thanks

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed