Perform internal image refactoring for better performance.