Calculate itemsPerRow on a separate AsyncTask