remove unused imports and prepare image url for caching