remove extra images and edit input files