Difference image analysis of galactic microlensing. I. Data analysis