Fixed memory leak issues by adding image cache. Improved performance by removing explicit call to GC.