Add some validations, replace some deprecated functions, avoid the allow images message and put it before send the image - refs BT#