use the valid layer name as file name on the disk, fixes #1713