fix error on saving as PNGs or AVI