If you have upgraded to version 2.x nextgen gallery you get memory problems 500, error, or blank pages. You have a problem in the wp-options table. Run this command to restore the database.
After that 'you do downgrade to version 1.9.x
DELETE FROM wp_options WHERE option_name like '_transient_%' OR option_name like 'displayed_galleries%'