Fixed atlas size finding function.