I wanted to do something very similar a couple of years ago for a project I was working on, albeit on a lot smaller scale with only 100 images. At the time, I came across the following page, so saved a link to it along with my project, so I could find it again:
https://superuser.com/questions/3474...mages-using-ff
I don't know if it is helpful here?