images are now written into StringIO