So, here is another version of the patch. I'm not quite sure for the docstring of image-dired-thumb-name.