Change the cache Image Number to params.cacheImageNum instead of 2.