expand when image is rotated 90 degree; add PYTHONPATH if necessary.