Fixed bugs on new db + Memory image dialog

Fixed error in SQL
Optimized code to check if to add column
Fixed error in try/catch not creating the db