Fix cache subdir

When working out the cache directory, the subdir used was that returned from wp_uploads_dir(), and therefore the current directory path, which changed each month. This means that the cache is fully regenerated each month.

Fix this by deriving the subdir from the original file path.

Also do this for theme files passed through wpthumb.