added padding to id in filename

This pads the ID part of the filename to 4 places (thousands) so that filenames are always ordered correctly in directory listings.