added multithreading support
added option to change the number of pictures
handle FILE pointer with unique_ptr