thumbnail script+saving in db now working