fix BMP and prepare for PNG