writting file to image. need to include creation and modify time fields