avoid crashing bug when trying to allocate an image thats too large