cleaning up the metadata creation

a memory leak was discovered and traced back, but without 100 percent
certainty, to the database of metadata. This has been fixed by
generating a text file for each image.