Added overwrite flag to skip images that already exist