Make the kernel image format parametric instead of a chain of if/elses

Conflicts:

	core/tasks/kernel.mk

Change-Id: I54bfcdecb8647f7bcf744e72b2de19fcf4e4e7ac