WPImageOptimizer: Fixing memory leak

This PR fixes #1876