Adds image and mask features, fixes clippath
Reduces amount of used memory during PNG creation.
Merge pull request #5162 from yurydelendik/pramodhkp-fixupgstate2

[SVG] Reduces amount of used memory during PNG creation.