Various fixes

NB: This commit has only the changes specific to the grnet repo (I PRed a batch of my other changes to upstream - osuosl repo). I realise I could just commit to this repo, but I am doing this as a PR too, so it is easier for @alexkiousis to review alongside the other PRs, and incorporate/cherry-pick/etc (as it touches parts of the code he is still PRing upstream too):

* change IMG_FORMAT= to IMAGE_TYPE= (g.i.i uses the latter)
* actually call cleanup at the end of two hooks
* remove extra CLEANUP=() in one hook (which resets cleanup tasks)
* remove unneeded setting of cleanup traps at start of hooks (already set
  in common.sh)
* add missing $ in two variable tests
* use $MKDIR_P instead of hardcoded mkdir -p in two files