Hi,
this is more like building a template project for premier or after effects or final cut pro where there will be placeholders for images. you will replace the images in the placeholders, and do a render. new video with new images inside the same pattern will be generated. I can do this for you. I can supply you a template project in premier, after effects or final cut pro format which will replace the images as you want.
But if you really want an intelligent code which will scan a video and replace a pattern with supplied pattern, then you will have to place this project in programming category.