Preprocess graphs to merge images in filesets