Fixing a bug in Loader.js.

A single fragment can be used as first frame for the animation of multiple tiles or entities, so we need to make sure we update the dimensions of all the affected tiles or entities.