Imaging scripts upgraded, flagging expansion fixed, final commits for stage 1 and 2 processing