Tidy utility code, work on thumbnail class