Implemented image caching.
Bug fixes