I think thats where the database comes in handy, where the ID is referenced to every image of that model.

cheers,
Luke