refactoring + method gray
 fixing the memory issue (no you cannot load 60 000 images with no compression in memory stupid.)