Deal with image directory