db insertion with validation

db insertion with validation is done (ad type: image, ad type: code)