Implement https://github.com/joomla-framework/image/pull/4