Collect variables at start of image writing