pwm: img: Test clock rate to avoid division by 0