Check if a texture is valid