Cache image data when loading textures