Avoids the "Too many open files" error in case of a large number of inpu...

...t files.

While trying to create an atlas file from 1200 images I reached the open file limit.

This patch allows to load them all closing the file descriptor after the file has been read.