restricting number of images to 5 and replacing tabs with spaces