Core Changes Fix memory leak in image optimization: #23565 Credits Huge thanks to @shuding for helping!