Edited test.py

Let test generates JPEG on memory.