implemented popups and image replace