Only create image thumbnails for images.
Write entire input stream, not just the number of available bytes.
Changes to be able to transport bytes with UnbufferedOutputFile.