refactoring for thumbnail view