img.py: fixed bug in !imgadd where invalid image name would cause the plugin to crash