Saving files with spaces in names failed. Had missed an instance of secure_filename