Fixed a segfault issue with gl::TexImage2D