Warning: [mysql error 145] Table './photogallery/piwigo_images' is marked as crashed and should be repaired

SELECT DISTINCT(WEEKDAY(date_creation)) as period,
  COUNT(DISTINCT id) as nb_images FROM piwigo_images
INNER JOIN piwigo_image_category ON id = image_id
    WHERE (category_id NOT IN (951,952,1878,1638,1220,930,719,653,1007,1215,746,1834,1851,842,843,646,1892,1893,1720,1729,42,1173,121,1857,1169,1868,1490,1504,1154,1014,683,1676,1313,1501,190,1759,650,110,184,111,185,1906,1408,1279,1445,886,959,958,949,94,1575,1683,638,97,1704,1100,1249)) AND date_creation BETWEEN '2017-01-01' AND '2017-12-31 23:59:59' AND WEEK(date_creation, 5)+1=9
  GROUP BY period; in /webapp/photogallery/include/dblayer/functions_mysqli.inc.php on line 832
Fatal error: Call to a member function fetch_assoc() on a non-object in /webapp/photogallery/include/dblayer/functions_mysqli.inc.php on line 880