Let me see if i understand you correctly. You have a comp with a bunch of pictures(the number may differ over time) and a camera. And you want the camera to hover over all the pictures with a preset animation/focus time. If so, you can use this
animDur = 1;
focusDur = 0.5;
totalCycle = animDur+focusDur;
otherLayers = 1;
picsNumber = thisComp.numLayers-otherLayers;
sector = Math.floor(time/totalCycle);
x = (time < (picsNumber - 1)*totalCycle) ? ease(time, sector*totalCycle , sector*totalCycle+animDur, thisComp.layer("Name "+ (sector+1)).transform.position[0], thisComp.layer("Name "+ (sector+2)).transform.position[0]) : value[0];
[x,value[1]]
animDur is the duration of the movement from one picture to another;
focusDur is how much the camera stays on a particular picture;
otherLayers is the number of layers inside the comp that are not pictures named “Name 1”, “Name 2” etc
For your information, if you put the picture from layer 1 towards bottom, you can use this(i think this variant is actually faster):
animDur = 1;
focusDur = 0.5;
totalCycle = animDur+focusDur;
otherLayers = 1;
picsNumber = thisComp.numLayers-otherLayers;
sector = Math.floor(time/totalCycle);
x = (time < (picsNumber - 1)*totalCycle) ? ease(time, sector*totalCycle , sector*totalCycle+animDur, thisComp.layer(sector+1).transform.position[0], thisComp.layer(sector+2).transform.position[0]) : value[0];
[x,value[1]]
Andrei
My Envato portfolio.