Batch processing DEM-assisted coregistration

Hi all! I have a bunch of images I want to stack together using DEM-assisted coregistration. I can do this manually but want to batch process it as I have a lot of images. For example, say I have a list of images - a, b, c, d, etc. - I want to stack a with b, b with c, c with d and so on. However, when I run the batch processing tool (using a simple graph) it only stacks the first and last image (e.g. a + z), although it does the same number of times I have files. In the end I just get one stacked image. Is there a way to get around this? Any help is much appreciated!