libpng: Fix for memory leak while indexing the PNG images