Extract resource loading to xblock utils

(Nit) Looks suspicious: replaced some calculated value to hard-coded. At least it's a "magic constant" - it might make sense to introduce real constant even if it has single usage here.