modified to use half-size bitmap on OutOfMemory