I'm not sure what to pass in for the fromstring module. But you can do something like this to save a JPEG image from string buffer:

newImage = Image.fromstrin g('L', (325, 256), cached_image_st ring)
newImage.save(f ilename, "JPEG")...