Updated encoder for libpng changes.