Inversion of asteroid photometry from Gaia DR2 and the Lowell Observatory photometric database