corrected the truncate method in insertpictures