Added debugging code
Implemented memorise function of a image directory