attempting write to file for images