simplify thumbnail code
bug fixes
Merge pull request #56 from ccd0/thumbnails

simplify frontend thumbnail code