Catch image exceptions in calc_cell_size