img_pil:check for attribute's existance before accessing it. closes #264...

...1