I tried using f = open(f"{imageFileName[:-4]}.art", "w") to create a new empty file with .art extension. I wasn't sure if this was the right way to change the file extension because Thonny didn't allow me to open this new file.
This looks like it's basically a duplicate question to what Elizabeth asked earlier here:
http://lovelace.augustana.edu/q2a/index.php/4742/how-do-you-make-art-a-text-file
Short version: there's probably nothing wrong with your .art file, you just need to work harder to get it opened in some program that can open text files.