plug-ins: Fix build with libpng versions < 1.4.

This was broken in 640f11f9c1d4cf45b81fdadc9555d891baab897b

(cherry picked from commit d296a2c08a00f643177c7bacc0166d60417f579a)