Bug 949360 - Check for Image AllocateBuffer() failures. r=nical

Relanded on a CLOSED TREE