Fix image popup closing.