Difference image analysis: automatic kernel design using information criteria