Contextmanager that change MAXBLOCK in ImageFile.

def image_save_buffer_fix(maxblock=1048576):
    """
    Contextmanager that change MAXBLOCK in ImageFile.
    """
    before = ImageFile.MAXBLOCK
    ImageFile.MAXBLOCK = maxblock
    try:
        yield
    finally:
        ImageFile.MAXBLOCK = before