Check if template file exists

To prevent errors on frontend when a non-existing template file is used, I've added a check during template editing to check if file exists after update/save.