Make saving thumbnail compatible with python3

1. Changed StringIO to io.BytesIO
2. Simplify the process of getting the processors