Fixed some things that prevented to store gallery info in the database
Updated TODO