Python Write Image To File