Restructure images