added conditional saving of images on local or dropbox