refactored the image File cache system to the location api

(for more general usage such ass accessing SMB shares for cached images)