Change justified gallery to ouput images in divs