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

SELECT id
  FROM piwigo_images i 
    INNER JOIN piwigo_image_category ic ON id=ic.image_id
    INNER JOIN piwigo_image_tag it ON id=it.image_id
    WHERE tag_id IN (586)
  AND (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))
  GROUP BY id
ORDER BY date_creation DESC, id ASC 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 893