Exception: Data must be 1-dimensional appears when trying to make a submission
Python tells you that the data you give for the column "predictions" is not 1-dimensional (i.e. it's not a flat list). And indeed preds is not a 1-dimensional array, what you want to give is the corresponding labels that you collected in predictions.

So Instead of this: 

results=pd.DataFrame({"image ID":filenames,
                  "Predictions":preds})


you probably want:

results=pd.DataFrame({"image ID":filenames,
                  "Predictions":predictions})