take average time for compression of all images in directory