\Magento\Framework\Image\Adapter\Gd2::rotate() does not free the previous GD image resource _imageHandler with imagedestroy before creating a new one

https://github.com/magento/magento2/blob/2.0.0/lib/internal/Magento/Framework/Image/Adapter/Gd2.php#L377

The core often uses the same \Magento\Framework\Image\Adapter\Gd2 instance for multiple images and image operations so it lead to unoptimal memory usage: the memory can not be reused by Magento until the request processing ends.
See the top comments here: http://php.net/manual/en/function.imagedestroy.php

https://github.com/magento/magento2/issues/2754