In creating spk image, the section which filesz is 0 is ignored, so change to check memsz instead of filesz.