chmod of images and clean code