This could be handled by the picture thumbloader.

You probably want to also use item->IsVideo() et. al. to handle a few more cases as well.