How do I make the thumbnail function return two values (a persistent model index and an image)?

Also, I think that to make it easier to manage I need the model's internal list to be one of filename/thumbnail pairs. How wouldI do that?