Image modal not showing up due to scope issue