improve conversion to PNG