Added thumbnailing. and lots of abstract functionality.