Background derivation and image flattening: getimages A. Men’shchikovA&A, 607 (2017) A64DOI: https://doi.org/10.1051/0004-6361/201730925