Optimized analysis method for indirect dark matter searches with imaging air Cherenkov telescopes