Based on the image you’ve posted, it looks like you should just reuse the layer where “share weight” is pointed to.
I’m not sure how your code snippet relates to the image, since it seems your need two inputs (image sequence and a single image?).