Print function now remembers how images are grouped by