bug fixes, improving image caching