Factor out file loading from texture binding.