speeded up integral image calcs