Fixes WebGL Warning if Invalid Texture

With WebGL, it's possible to get lots of warnings (and slow down the browser) if a texture is loaded that has no width or height. The following warnings will be generated:

WebGL: INVALID_VALUE: texImage2D: no canvas CCTexture2D.js
[.WebGLRenderingContext]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering or is not 'texture complete' (index):1
WebGL: too many errors, no more errors will be reported to the console for this context.

This pull request fixes the bug by checking the HTML element's width and height before trying to turn it into a texture.
Merge pull request #1805 from NatWeiss/patch-10

Fixes WebGL Warning if Invalid Texture