Calculate number of tile based on desired image dimensions.