Some changes and fixes of imageInserter