Reorganized the thumbnail code to make it easier to implement video and music