When the texture image is scaled, we don't properly know its size, so we were allocating too small of a buffer. Since this is only used for debugging, let's just get the actual texture size.