Pre merge and re-render image gallery