At a guess I'd suggest the thing that's breaking is this line:
filePathSplit = filePath.split("/")
Because pdb.gimp_image_get_filename(image) is going to return a filepath in Windows format because you're runing GIMP on Windows. i.e.
C:\Users\ethan\Desktop\Test.xcf
You should probably use os.path.dirname(path) to get the directory name: https://docs.python.org/2/library/os.path.html
filePathSplit = filePath.split("/")
Because pdb.gimp_image_get_filename(image) is going to return a filepath in Windows format because you're runing GIMP on Windows. i.e.
C:\Users\ethan\Desktop\Test.xcf
You should probably use os.path.dirname(path) to get the directory name: https://docs.python.org/2/library/os.path.html