Improved popup styles and fixed bugs with preview image