Changed to C API for lodepng and flipped PNG rows