updated code for sms and image