In the code this line:
imageFormat = hdaNode.parm('imageFormat').eval()
defines an empty string. "hdaNode.parm('imageFormat')" is non null - "imageFormat" is a Name of this string parameter.
I used the same approach to read a file-directory parameters and it was working well.
Am I missing something?