Added check for null argument for --image_dir