refactor dialogues class and transparentIMG dialog