fix detector's coordinate mapping for images smaller than IMAGE_DIM
Properly index windows in detector list mode

Fix iteration over single windows: whether one or more windows are
listed for an image, generate windows as a list.