Refactoring according to CR: thumbnails stuff