Fix resizing bug. The displayed image does not necessarily come from the currently selected collection. To reproduce crash: display an image, resize window, select another collection (but not another image!), resize again.