optimize png and modify template