Fix chmod for template and image json