Add function to calculate tile grid shape required to cut and image into fixed size tiles