Fix the png generation and detection