[textures] move image wrapping functions into a separate class