Optimized encoding by using Field<2,unsigned char>; not sure how fast it is
File list sort to avoid messing up image order