Fix incorrect error being raised when trying load a None object as an
image with imagemagick.