Added parameter input to flatten_image.py