check for image memory allocation errors