I have some more information, from my apache2 log.
WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ASC LIMIT 0, 10’ at line 1 for query SELECT pid FROM wp_ngg_pictures WHERE galleryid = ‘1’ AND exclude != 1 ORDER BY ASC LIMIT 0, 10 made by do_action(‘media_upload_nextgen’), call_user_func_array, media_upload_nextgen, wp_iframe, call_user_func_array, media_upload_nextgen_form, referer: http://www.mydomainname.ca/wp-admin/media-upload.php?type=file&tab=nextgen&post_id=1881&select_gal=210&paged=1
My mysql version:
+————————-+——————+
| Variable_name | Value |
+————————-+——————+
| innodb_version | 5.5.44 |
| protocol_version | 10 |
| slave_type_conversions | |
| version | 5.5.44-0+deb8u1 |
| version_comment | (Raspbian) |
| version_compile_machine | armv7l |
| version_compile_os | debian-linux-gnu |
+————————-+——————+