Fixes null pointer crash with texImage2D

Fixes null pointer crash if user gives null parameter as image.
Improved logging added for texture images.

Change-Id: I03d420d368232d4b84fceaa27a85c8bbc32e8429
Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>