adding an error handler & popup for image sending