Fixed a bug that causes PNG generation everytime