Fix png writing for old FFmpeg versions