Code cleanup
Added image caching
Code cleanup