Show-hide images not activating when passing variables