I had a similar issue after the WP5 upgrade. What resolved it for me was moving the NextGen Gallery folders out of the plugins folder. The I loaded the WP plugins page where I got the error message that the NextGen folders were missing. I then moved the NextGen Gallery folders back to the plugins folder, refreshed the WP plugins page and activated the two NextGen plugins again. I am still keeping an eye on it. I have a second site that did not have this issue.