mksd_image: clean up the code

Signed-off-by: Bo Shen <voice.shen@atmel.com>