mkimage: Fix variable length header support