Refactored previewer.py to be simpler and more pythonic.
Base size limit on total number of pixels since that is what tagpro servers do.