MEDEA: a real time imaging pipeline for pixel lensing