update for working with any format
functional for few files
memory leak fix

20 images at once