I think instead of using pixel measurements, you can probably get around the different image sizes using:
thisLayer.width and thisLayer.height
These will give you the sizes in order to drive any expressions.
You could also use thisComp.width etc… to determine the “off screen” placement.
And you could look at something like this expression:
transition = 20; // transition time in frames
if (marker.numKeys<2){
tSecs = transition / ( 1 / thisComp.frameDuration); // convert to seconds
linear(time, inPoint, inPoint + tSecs, 0, 100) - linear(time, outPoint - tSecs, outPoint, 0, 100)
}else{
linear(time, inPoint, marker.key(1).time, 0, 100) - linear(time, marker.key(2).time, outPoint, 0, 100)
}
which fades a layer in and out automatically. I think it would be pretty straight-forward to adapt for position, but if you get stuck, post back here and I’ll see if I can help you out.