Fixed atlas bug for non-power of 2 atlases.