Added dirty stuff for grouping images