Fixed minor bug with picture file writer