refactored image modal