Fix issues with the image mode
Merge pull request #1 from grampajoe/image-mode-error

Fix issues with the image mode