Added Mouse Detection Function and Selected alternate image