I identified a situation where pngs would be converted to jpegs even when png_to_jpg_quality was set to 100, and merged in a fix just now. Hopefully this addresses the problem you had encountered.
Can you update your Discourse instance and let us know if the problem has been resolved?