Fixes #1439.
Merge pull request #1551 from xiaohutai/bugfix-for-imagelist

Fixes #1439.