Use JavaScript to build grid elements to cover image