find global maximum in image