This works, but I would not recommend that. A much easier way - without any code changes - is clicking the "Mipmaps" checkbox in MED skin settings. It then also loads faster.

For external textures the skin settings have no effect, but you can then use DDS textures with mipmaps.