[IMP][CLEAN] : improve and clean code for link and media dialog