Fix AttributeError: class Image has no attribute 'DEBUG'