Fixes #2204
For Imagine v0.5 (previous code was for 0.6 dev)
Merge pull request #2229 from klevron/2204

Fixes #2204