configure: only require libpng when needed