#h: return nil if string.to_s is nil

I had a problem where when my `image` field (Using CarrierWave and Sequel) was empty, this line would throw NoMethodError `gsub` on nil. I have no idea if this is common enough to merge into master.